Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command-line log-level no longer accepts categories (dev) #1619

Open
jagerman opened this issue Dec 19, 2022 · 3 comments
Open

Command-line log-level no longer accepts categories (dev) #1619

jagerman opened this issue Dec 19, 2022 · 3 comments
Assignees

Comments

@jagerman
Copy link
Member

jagerman commented Dec 19, 2022

Current dev introduces a few regressions in log-level handling:

  • The --log-level (or log-level=... in the config file) can no longer be set to a categorized string, but only to a single global level. This is really useful when debugging one particular subsystem to be able to throw it into debug logging while not getting debug logs from other bits.

    It looks like we do have log level parsing in logging/oxen_logger.cpp, but it seems to only be used via RPC, but isn't called by daemon/main.cpp, so this is probably just a matter of wiring it up.

  • Never mind, I'm wrong about this: The numeric values given to log-level don't work the same as they used to: they used to map to a categorized list of levels so that level "2" would show info from some categories, warning from some.

@jagerman jagerman changed the title Command-line log level regressions Command-line log-level no longer accepts categories (regression in dev) Dec 19, 2022
@jagerman jagerman changed the title Command-line log-level no longer accepts categories (regression in dev) Command-line log-level no longer accepts categories (dev) Dec 19, 2022
@jagerman
Copy link
Member Author

One thing to keep in mind that might be an edge case in the current implementation: the meaning of --log-level=*:info is different from --log-level=info: the latter uses the pre-selected list of category levels (now in oxen_logger.cpp), but the former means "set everything to info level".

@jagerman
Copy link
Member Author

Another issue: in process_categories_string if the given level is unknown (e.g. "cat:FOO") then nothing happens, but that should probably raise an exception rather than silently ignoring it.

@jagerman
Copy link
Member Author

Also: if it hasn't merged yet by the time you start working on this, there's a related commit (with title "Log levels: ...") that ought to be cherry-picked that makes the levels case-insensitive and adds some abbreviations to the levels list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants