1
0
Files
electrum/electrum
SomberNight 111043f8b4 logging: add a relative timestamp to stderr console logs
In the past we decided not to put a timestamp into the stderr logs
to have shorter log lines (to save column width in a terminal).
However over time I at least have found that it would be valuable
to have timestamps also in the stderr - e.g. when users provide logs.
Often I am only interested in the time taken between logged events,
so as a compromise to still save some length, I propose adding relative
timestamps (relative to process startup time).

Compare these log lines from the file logger:

```
20220816T120601.882003Z |     INFO | gui.qt.ElectrumGui | starting Qt main loop
20220816T120601.905619Z |     INFO | gui.qt.history_list.HistoryModel | refreshing... reason: update_tabs
20220816T120601.911908Z |    DEBUG | util.profiler | Abstract_Wallet.get_full_history 0.0059 sec
20220816T120602.095670Z |     INFO | interface.[testnet.hsmiths.com:53012] | connection established. version: ['ElectrumX 1.16.0', '1.4']
```
With these from the existing stderr logger:
```
I/w | wallet.Standard_Wallet.[test_segwit_3] | set_up_to_date: True
I/i | interface.[testnet.aranguren.org:51002] | set blockchain with height 2343721
D | util.profiler | ElectrumWindow.load_wallet 0.0778 sec
I | gui.qt.ElectrumGui | starting Qt main loop
```
With these re what I propose for the stderr logger:
```
  3.20 | D | util.profiler | Abstract_Wallet.get_full_history 0.0029 sec
  5.70 | I | i/interface.[testnet1.bauerj.eu:50002] | disconnecting due to: ConnectError(ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None))
 38.63 | I | w/wallet.Standard_Wallet.[9dk] | starting taskgroup.
 38.84 | D | util.profiler | WalletDB._write 0.0059 sec
 62.96 | I | i/interface.[blockstream.info:993] | set blockchain with height 2343722
150.65 | I | exchange_rate.CoinGecko | getting fx quotes for EUR
```
2022-11-06 06:20:41 +00:00
..
2022-07-07 18:29:01 +02:00
2022-10-20 18:43:54 +00:00
2021-04-08 19:49:43 +02:00
2022-04-11 17:40:22 +02:00
2022-10-31 16:13:22 +00:00
2021-07-15 14:52:25 +00:00
2022-08-31 11:03:04 +02:00
2021-07-16 11:27:36 +02:00
2022-07-22 13:01:21 +08:00
2021-03-21 00:36:23 -04:00
2022-10-31 16:13:22 +00:00
2021-03-21 00:36:23 -04:00
2022-04-11 17:40:22 +02:00
2022-10-31 16:13:22 +00:00
2022-10-31 16:13:22 +00:00
2021-05-06 19:47:22 +09:00
2022-08-03 14:03:27 +00:00
2021-06-22 19:24:16 +02:00
2022-09-29 12:13:22 +02:00
2022-09-26 20:13:45 +02:00
2022-10-31 16:13:22 +00:00