Shorten time format in ui and log.

2024-05-20_merge
tecnovert 1 year ago
parent 0be5a4fca7
commit 9efb244952
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93
  1. 4
      basicswap/base.py
  2. 1
      basicswap/interface/btc.py
  3. 2
      basicswap/util/__init__.py

@ -76,10 +76,10 @@ class BaseApp:
# Remove any existing handlers # Remove any existing handlers
self.log.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() stream_stdout = logging.StreamHandler()
if self.log_name != 'BasicSwap': 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: else:
stream_stdout.setFormatter(formatter) stream_stdout.setFormatter(formatter)
stream_fp = logging.StreamHandler(self.fp) stream_fp = logging.StreamHandler(self.fp)

@ -366,6 +366,7 @@ class BTCInterface(CoinInterface):
return override_feerate, 'override_feerate' return override_feerate, 'override_feerate'
min_relay_fee = chain_client_settings.get('min_relay_fee', None) min_relay_fee = chain_client_settings.get('min_relay_fee', None)
def try_get_fee_rate(self, conf_target): def try_get_fee_rate(self, conf_target):
try: try:
fee_rate = self.rpc_callback('estimatesmartfee', [conf_target])['feerate'] fee_rate = self.rpc_callback('estimatesmartfee', [conf_target])['feerate']

@ -181,7 +181,7 @@ def format_timestamp(value: int, with_seconds: bool = False) -> str:
str_format = '%Y-%m-%d %H:%M' str_format = '%Y-%m-%d %H:%M'
if with_seconds: if with_seconds:
str_format += ':%S' str_format += ':%S'
str_format += ' %Z' str_format += ' %z'
return time.strftime(str_format, time.localtime(value)) return time.strftime(str_format, time.localtime(value))

Loading…
Cancel
Save