I made a few updates to improve the log outputs and work towards standardizing the outputs.
I tried to uncover the closest thing to a convention that I could. And here are the principles that I gleaned:
- start the line with the log label/type followed by a colon
- have the log label start with a capital letter and be expressed in the present progressive (-ing) or past tense (-ed), depending on whether the event/process is ongoing or an event has been completed
- after the colon, present a list of properties/attributes/details of the output, where each property is expressed with its name followed by the equals sign and then its value
- separate each property by two spaces
- express the property names using camelCase
In addition to these changes, I:
- made sure that "blk" was included in quotes to make it clear to the user that "blk" is a proper name given to a certain type of file and not an actual word.
- included quotes around the names of threads starting up so that it's clear that the threads are referred to by their proper names
A few things that still bother me about the outputs:
- there are a few cases where output lines include single properties that don't follow the output convention, for example:
mapBlockIndex.size() = 374551 nTimeOffsetlogs are presented in a strange way, where it's unclear that the first value is in seconds (it explicitly says the value after that is in minutes, but that value in my experience is usually zero)- there are a few cases where the output lines start with a function name rather than describing what is happening, as is the case with most logs (for example
connect() to... - logs starting with
UpdateTipcould be more descriptive - more specifically, when a new block has been discovered, they should communicate that a new block has been discovered - "init message" logs seem out of place from other logs
Also, while I stuck with the conventions that I could best glean from the outputs I observed, I would suggest making a few changes to the conventions. Namely, the following:
- start the line with the name of the thread
- enforce that every line after the name of the thread starts with an action in the present progressive or past tense (as most, maybe 80%, of the logs already seem to do)
- either use commas to separate log properties or prohibit property names that include spaces, strictly enforcing a certain case (either camelCase or snake_case)
- combine the init log properties like
mapBlockIndex.size()andnBestHeightinto a single line and enforce this for other outputs that have multiple properties OR if this is not desired, then have additional newlines separating the outputs to make it clear that those properties are grouped together