Skip to content

Remove trace lines about NO_COLOR. #107

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

Merged
merged 1 commit into from
Sep 13, 2021
Merged

Conversation

qbit
Copy link
Contributor

@qbit qbit commented Sep 12, 2021

Currently there is a warning for every command run when NO_COLOR is set. For example:

$ headscale nodes 
{"level":"trace","time":"2021-09-12T07:31:48-06:00","message":"NO_COLOR is set, disabling colors"}
Manage the nodes of Headscale

Usage:
  headscale nodes [command]

Available Commands:
  delete      Delete a node
  list        List the nodes in a given namespace
  register    Registers a machine to your network
  share       Shares a node from the current namespace to the specified one

Flags:
  -h, --help               help for nodes
  -n, --namespace string   Namespace

Global Flags:
  -o, --output string   Output format. Empty for human-readable, 'json' or 'json-line'

Use "headscale nodes [command] --help" for more information about a command.
$

This disables that.

@kradalby
Copy link
Collaborator

I don't have strong opinions of this, iirc this might be set up before the log level?

If it can disabled by setting lower than tracing, I would suggest that rather than removing.

@qbit
Copy link
Contributor Author

qbit commented Sep 12, 2021

I am using the default log level - and the output happens on the command line.

Personally - I think it's annoying. I know I have color disabled, I set NO_COLOR explicitly and any thing that is informing me of that is just adding noise.

@qbit
Copy link
Contributor Author

qbit commented Sep 12, 2021

by "default log level" I mean I have nothing explicitly set in my config.json that increases or decreases the logging.

Copy link
Collaborator

@kradalby kradalby left a comment

Choose a reason for hiding this comment

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

Your right, the lines are printed before we set the log level, let's just remove them

@juanfont juanfont merged commit e1d5da5 into juanfont:main Sep 13, 2021
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