From 9efb244952f40ca7ad4b61c40c6271ba8d5aa028 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Fri, 1 Dec 2023 21:30:23 +0200 Subject: [PATCH] Shorten time format in ui and log. --- basicswap/base.py | 4 ++-- basicswap/interface/btc.py | 1 + basicswap/util/__init__.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/basicswap/base.py b/basicswap/base.py index b947d28..1cd243e 100644 --- a/basicswap/base.py +++ b/basicswap/base.py @@ -76,10 +76,10 @@ class BaseApp: # Remove any existing handlers self.log.handlers = [] - formatter = logging.Formatter('%(asctime)s %(levelname)s : %(message)s') + formatter = logging.Formatter('%(asctime)s %(levelname)s : %(message)s', '%Y-%m-%d %H:%M:%S') stream_stdout = logging.StreamHandler() if self.log_name != 'BasicSwap': - stream_stdout.setFormatter(logging.Formatter('%(asctime)s %(name)s %(levelname)s : %(message)s')) + stream_stdout.setFormatter(logging.Formatter('%(asctime)s %(name)s %(levelname)s : %(message)s', '%Y-%m-%d %H:%M:%S')) else: stream_stdout.setFormatter(formatter) stream_fp = logging.StreamHandler(self.fp) diff --git a/basicswap/interface/btc.py b/basicswap/interface/btc.py index aa8d76e..6e723e0 100644 --- a/basicswap/interface/btc.py +++ b/basicswap/interface/btc.py @@ -366,6 +366,7 @@ class BTCInterface(CoinInterface): return override_feerate, 'override_feerate' min_relay_fee = chain_client_settings.get('min_relay_fee', None) + def try_get_fee_rate(self, conf_target): try: fee_rate = self.rpc_callback('estimatesmartfee', [conf_target])['feerate'] diff --git a/basicswap/util/__init__.py b/basicswap/util/__init__.py index a2c91a5..f2fca91 100644 --- a/basicswap/util/__init__.py +++ b/basicswap/util/__init__.py @@ -181,7 +181,7 @@ def format_timestamp(value: int, with_seconds: bool = False) -> str: str_format = '%Y-%m-%d %H:%M' if with_seconds: str_format += ':%S' - str_format += ' %Z' + str_format += ' %z' return time.strftime(str_format, time.localtime(value))