doc: update -loglevel help to add info to the always logged levels #29230

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:2024-01-fix-loglevel-help changing 1 files +1 −1
  1. jonatack commented at 3:48 pm on January 11, 2024: contributor

    Commit ab34dc6012351e7b8aab871dd9d2b38ade1cd9b of #28318 was an incomplete version of 118c756 (#25203) from the Severity-based logging parent PR.

    Add the missing text to update the -loglevel help doc.

    While here, make the help text a little easier to understand.

    Can be tested by running:

    0./src/bitcoind -regtest -help-debug | grep -A12 loglevel=
    

    before

    0  -loglevel=<level>|<category>:<level>
    1       Set the global or per-category severity level for logging categories
    2       enabled with the -debug configuration option or the logging RPC:
    3       info, debug, trace (default=debug); warning and error levels are
    4       always logged.
    

    after

    0  -loglevel=<level>|<category>:<level>
    1       Set the global or per-category severity level for logging categories
    2       enabled with the -debug configuration option or the logging RPC.
    3       Possible values are info, debug, trace (default=debug). The
    4       following levels are always logged: error, warning, info.
    
  2. DrahtBot commented at 3:48 pm on January 11, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Docs on Jan 11, 2024
  4. jonatack force-pushed on Jan 11, 2024
  5. doc: add unconditional info loglevel following merge of PR 28318
    The `info` loglevel is now logged unconditionally following that merge.
    
    While here, make the help text easier to understand.
    ec779a2b8e
  6. in src/init/common.cpp:34 in 607869dbaa outdated
    30@@ -31,7 +31,7 @@ void AddLoggingArgs(ArgsManager& argsman)
    31         ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
    32     argsman.AddArg("-debugexclude=<category>", "Exclude debug and trace logging for a category. Can be used in conjunction with -debug=1 to output debug and trace logging for all categories except the specified category. This option can be specified multiple times to exclude multiple categories.", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
    33     argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
    34-    argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC: %s (default=%s); warning and error levels are always logged. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
    35+    argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are %s (default=%s). The following levels are always logged: info, warning, error. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
    


    stickies-v commented at 4:25 pm on January 11, 2024:

    LGTM. Since we’re already hardcoding “info, warning, error”, should we hardcode the allowed levels too and exclude (just in docs) warning and error to make it more clear that warning and error are really just info?

    0    argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are info, debug, trace (default=%s). The following levels are always logged: info, warning, error. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
    

    jonatack commented at 4:33 pm on January 11, 2024:

    Thanks! On current master, I think warning and error are already excluded from the allowed levels (if I correctly understand the suggestion).

    0$ ./src/bitcoind -regtest -help-debug | grep -A12 loglevel=
    1  -loglevel=<level>|<category>:<level>
    2       Set the global or per-category severity level for logging categories
    3       enabled with the -debug configuration option or the logging RPC:
    4       info, debug, trace (default=debug); warning and error levels are
    5       always logged. If <category>:<level> is supplied, the setting
    6       will override the global one and may be specified multiple times
    7       to set multiple category-specific levels. <category> can be:
    

    Edit: updated the pull description to show the help doc before/after.


    stickies-v commented at 5:05 pm on January 11, 2024:
    Sorry I didn’t check and just assumed it printed all levels 🤦 resolved indeed.
  7. jonatack force-pushed on Jan 11, 2024
  8. jonatack commented at 5:05 pm on January 11, 2024: contributor
    Re-pushed to provide the accepted log levels and the always-logged ones in the same order of severity (descending).
  9. stickies-v approved
  10. stickies-v commented at 5:06 pm on January 11, 2024: contributor
    ACK ec779a2b8e4fcc00596ee8833be35ae9b326552c
  11. jonatack renamed this:
    doc: update -loglevel help following merge of PR 28318
    doc: update -loglevel help to add `info` to the always logged levels
    on Jan 11, 2024
  12. DrahtBot added the label CI failed on Jan 15, 2024
  13. fanquake merged this on Jan 16, 2024
  14. fanquake closed this on Jan 16, 2024

  15. jonatack deleted the branch on Jan 16, 2024

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-07-03 19:12 UTC

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