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

FileLogger not using log level correctly #14

Open
Tri125 opened this issue Jun 6, 2016 · 0 comments
Open

FileLogger not using log level correctly #14

Tri125 opened this issue Jun 6, 2016 · 0 comments

Comments

@Tri125
Copy link

Tri125 commented Jun 6, 2016

Not sure if this is a standard everywhere, but from a logger what I would define as expected usage is that:

  • Any messages below the logger level will not be tracked. It will not be displayed or written to file.
  • Any messages at or above the logger level will be tracked. It will be displayed and/or written to file.

I've set a FileLogger to INFO level. However, one of my Info level messages will not print on console, but it will be written in the file:

 logger.Info(ip, " POST failed validation: ", gridPost)

The above syntax works with fmt.Printf() syntax.

If I switch the message to Warn level, it will still not print on console.

Now, here's where things gets even more interesting.

If I create my FileLogger at WARN level, I still have Info messages being printed out on the console (but not written to file), my Warn messages still doesn't get printed but some are correctly written.

I'm unable to accurately describe examples because it all seems arbitrary.

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

No branches or pull requests

1 participant