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

Move ConfigureLoggers to the Context struct. #36

Merged
merged 1 commit into from
May 26, 2019

Conversation

howbazaar
Copy link
Contributor

It is good to be able to configure any logging context with a string.

err := context.ConfigureLoggers("testing.module=debug")
c.Assert(err, gc.IsNil)
expected := "<root>=INFO;testing.module=DEBUG"
c.Assert(context.Config().String(), gc.Equals, expected)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you be testing that the configured levels actually mean something (eg, debug messages are included for testing.module but not for a different logger?)
I'm slightly worried about user confusion (understanding that each context has its own logger config, etc.) but it does fit the issue we are trying to address (have explicitly different logging config for each model).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other tests that test that the configured loggers output the right levels, so I don't think it is necessary here.

Yes, I think there is the potential for confusion. The docs are pretty clear though.

@howbazaar
Copy link
Contributor Author

$$merge$$

@jujubot jujubot merged commit 6e530bc into juju:master May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants