Skip to content

Can't set loglevel of subsystems properly #150

Description

@RobQuistNL

I have a package that has a lot of subpackages. The loggers get initialized like this for each package;

var log = log2.Logger("hwdata:cli")
var log = log2.Logger("hwdata:system")
var log = log2.Logger("hwdata:cpu")

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions