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

*: clean up logging #73

Merged
merged 3 commits into from
Feb 6, 2017
Merged

*: clean up logging #73

merged 3 commits into from
Feb 6, 2017

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Feb 6, 2017

apex/log has much more useful handlers (formatters) for CLI tools. In
partciular, the "cli" handler is much better suited to command-line
tooling than any formatter available for logrus.

Add custom logging levels, defaulting to the logging level of warning.
This makes the output much less spammy.

Fixes #71

Signed-off-by: Aleksa Sarai asarai@suse.de

apex/log has much more useful handlers (formatters) for CLI tools. In
partciular, the "cli" handler is much better suited to command-line
tooling than any formatter available for logrus.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This is necessary to make it more obvious to users what is going on.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Add custom logging levels, defaulting to the logging level of warning.
This makes the output much less spammy.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
@cyphar cyphar added this to the 0.0.0 milestone Feb 6, 2017
log.SetHandler(logcli.New(os.Stderr))

if ctx.GlobalBool("verbose") {
if ctx.GlobalIsSet("log") {
Copy link
Member

Choose a reason for hiding this comment

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

You may want to no-op on log=info?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to make it so people don't mix the two at all. But thanks for the review.

@runcom
Copy link
Member

runcom commented Feb 6, 2017

Looks good!

@cyphar
Copy link
Member Author

cyphar commented Feb 6, 2017

Thanks @runcom!

@cyphar
Copy link
Member Author

cyphar commented Feb 6, 2017

LGTM

@cyphar cyphar merged commit fcf30c7 into master Feb 6, 2017
cyphar added a commit that referenced this pull request Feb 6, 2017
@cyphar cyphar deleted the switch-logging branch February 6, 2017 12:16
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.

2 participants