logs: Make the columns in subsequent UpdateTip log entries horizontally aligned #12984

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:attention-to-detail changing 1 files +3 −3
  1. practicalswift commented at 12:55 pm on April 14, 2018: contributor

    Make the columns in subsequent UpdateTip log entries horizontally aligned. This change improves usability by making it easier to follow the tx, date, progress and cache values over time.

    Before this commit:

    02019-01-01T00:00:01Z UpdateTip: new best=… log2_work=69.12542 tx=9560969 date='2018-12-05T18:58:07Z' progress=0.029954 cache=442.8MiB(3363038txo)
    12019-01-01T00:00:02Z UpdateTip: new best=… log2_work=69.125457 tx=9561022 date='2018-12-05T19:00:07Z' progress=0.029955 cache=442.8MiB(3362966txo)
    22019-01-01T00:00:03Z UpdateTip: new best=… log2_work=69.12549 tx=9561034 date='2018-12-05T19:05:44Z' progress=0.029955 cache=442.8MiB(3362970txo)
    32019-01-01T00:00:04Z UpdateTip: new best=… log2_work=69.125523 tx=9561231 date='2018-12-05T19:08:07Z' progress=0.029955 cache=442.8MiB(3363051txo)
    42019-01-01T00:00:05Z UpdateTip: new best=… log2_work=69.1255 tx=9561382 date='2018-12-05T19:20:45Z' progress=0.029956 cache=442.9MiB(3363120txo)
    

    After this commit:

    02019-01-01T00:00:01Z UpdateTip: new best=… log2_work=69.125420 tx=9560969 date='2018-12-05T18:58:07Z' progress=0.029954 cache=442.8MiB(3363038txo)
    12019-01-01T00:00:02Z UpdateTip: new best=… log2_work=69.125457 tx=9561022 date='2018-12-05T19:00:07Z' progress=0.029955 cache=442.8MiB(3362966txo)
    22019-01-01T00:00:03Z UpdateTip: new best=… log2_work=69.125490 tx=9561034 date='2018-12-05T19:05:44Z' progress=0.029955 cache=442.8MiB(3362970txo)
    32019-01-01T00:00:04Z UpdateTip: new best=… log2_work=69.125523 tx=9561231 date='2018-12-05T19:08:07Z' progress=0.029955 cache=442.8MiB(3363051txo)
    42019-01-01T00:00:05Z UpdateTip: new best=… log2_work=69.125500 tx=9561382 date='2018-12-05T19:20:45Z' progress=0.029956 cache=442.9MiB(3363120txo)
    
  2. fanquake added the label Utils/log/libs on Apr 14, 2018
  3. jnewbery commented at 4:42 pm on April 16, 2018: member

    Very weak concept ACK. More readable is more readable, and this should backwards compatible for any logs parsers. However, I doubt this is really causing any issues for users.

    You can remove the .6. Precision to 6 places is the default for the f specifier.

    Note that logs may still be misaligned, since height and tx are variable length:

    02018-04-16T16:34:54.121611Z UpdateTip: new best=656e322c61225c569e5ddff92a8fd76f5e75caedcb939c84e5c983b55d03e8d6 height=6 version=0x00000001 log2_work=3.807355 tx=7 date='2018-04-16T16:34:59Z' progress=1.000000 cache=0.0MiB(6txo)
    12018-04-16T16:34:54.122402Z UpdateTip: new best=4ff634020e0a6fa840ce804c060edf48cc6546e06a968f1ef35ea1c76a3c0296 height=7 version=0x00000001 log2_work=4.000000 tx=8 date='2018-04-16T16:35:00Z' progress=1.000000 cache=0.0MiB(7txo)
    22018-04-16T16:34:54.123955Z UpdateTip: new best=7a19ad4c4b46af72439150c63f7caf2cdc895b8965ebc2474ad446b64d4400df height=8 version=0x00000001 log2_work=4.169925 tx=9 date='2018-04-16T16:35:01Z' progress=1.000000 cache=0.0MiB(8txo)
    32018-04-16T16:34:54.125164Z UpdateTip: new best=29dc32b5768e040b0f4c7d113b318b4289822620df853acffb1d99e371ae7186 height=9 version=0x00000001 log2_work=4.321928 tx=10 date='2018-04-16T16:35:02Z' progress=1.000000 cache=0.0MiB(9txo)
    42018-04-16T16:34:54.126942Z UpdateTip: new best=25e6d690728852ebca2668184f593281ad8d8fe7b14453f16d26d59ec9dcf67f height=10 version=0x00000001 log2_work=4.459432 tx=11 date='2018-04-16T16:35:03Z' progress=1.000000 cache=0.0MiB(10txo)
    52018-04-16T16:34:54.128761Z UpdateTip: new best=05f226635e04ec8d7d03a77de80357a3bb63b12cd0feff4852e0efad72e57b87 height=11 version=0x00000001 log2_work=4.584963 tx=12 date='2018-04-16T16:35:04Z' progress=1.000000 cache=0.0MiB(11txo)
    
  4. logs: Make the columns in subsequent UpdateTip log entries horizontally aligned
    Make the columns in subsequent `UpdateTip` log entries horizontally
    aligned. This change improves usability by making it easier to follow
    the `tx`, `date`, `progress` and `cache` values over time.
    43dd50258e
  5. practicalswift force-pushed on Apr 16, 2018
  6. practicalswift commented at 6:25 pm on April 16, 2018: contributor

    @jnewbery Thanks for the review! I’m now using %f.

    I’m scratching my own itch here: I interact with bitcoind solely via the command-line and I find the column jumping due to the log2_work formatting to make the output harder to read (my logs consist almost solely of UpdateTip messages) :-)

    Usability is about making the overall experience more pleasant (often by small incremental improvements) – not necessarily “fixing issues” :-)

    In my experience height and tx are not a problem in the same way since they only jump to the right on 10x increases.

    Please re-review :-)

  7. jnewbery commented at 6:48 pm on April 16, 2018: member
    utACK 43dd50258ea48e6c6f49f4be5858e6c69c9597ed
  8. DrahtBot closed this on Jul 22, 2018

  9. DrahtBot commented at 12:54 pm on July 22, 2018: member
  10. DrahtBot reopened this on Jul 22, 2018

  11. ken2812221 commented at 9:28 am on September 25, 2018: contributor
    utACK 43dd502
  12. practicalswift closed this on Oct 22, 2018

  13. practicalswift deleted the branch on Apr 10, 2021
  14. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-06 16:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me