You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I include this project into another project, I want to set all the loglevels of this subsystem to info;
GOLOG_LOG_LEVEL="debug,hwdata=info" go run .
This doesn't work. It still shows hwdata:cpu with level debug.
Then I tried the "regex" setup that was described in the readme.md;
GOLOG_LOG_LEVEL="debug,hwdata:.*=info" go run .
This also doesn't work
I now have to write it like this;
GOLOG_LOG_LEVEL="debug,hwdata:cpu=info,hwdata:system=info,hwdata:cli=info" go run .
which is kind of ineffective, especially since I have about 20 of those subsystems. Shouldn't this just work on a subsystem level basis? Or is the ":" that is mentioned in the readme just arbitrary and doesn't it work with subsystems like that at all?
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
"Priority" labels will show how urgent this is for the team.
"Status" labels will show if this is ready to be worked on, blocked, or in progress.
"Need" labels will indicate if additional input or analysis is required.
The ":" is not a delimiter for a separate subsystem, it is part of the subsystem name in the examples. In your use case, hwdata:cli, hwdata:system, and hwdata:cpu are the separate subsystems.
Setting log levels and using a regex to match logger names is supported by the SetLogLevelRegex API, but is not available in the GOLOG_LOG_LEVEL environ variable.
Being able to detect the presence of a regex in the value of GOLOG_LOG_LEVEL, and then match against the regex when setting up log subsystems, would be a nice feature.
Activity
welcome commentedon Mar 18, 2025
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
Finally, remember to use https://discuss.ipfs.io if you just need general support.
gammazero commentedon Jun 5, 2025
The ":" is not a delimiter for a separate subsystem, it is part of the subsystem name in the examples. In your use case,
hwdata:cli,hwdata:system, andhwdata:cpuare the separate subsystems.RobQuistNL commentedon Jun 6, 2025
I think it works like this in the Lotus CLI.
The documentation also explains the use of the regex; https://github.com/ipfs/go-log?tab=readme-ov-file#usage
Would this be a nice feature to add?
gammazero commentedon Jul 6, 2026
Setting log levels and using a regex to match logger names is supported by the
SetLogLevelRegexAPI, but is not available in theGOLOG_LOG_LEVELenviron variable.Being able to detect the presence of a regex in the value of
GOLOG_LOG_LEVEL, and then match against the regex when setting up log subsystems, would be a nice feature.