-
Notifications
You must be signed in to change notification settings - Fork 1
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
Doc how to convert from logutils #2
Comments
Lol. Entering tickets from my phone is the worst. |
By setting the logger to take the square format it should just work. Agreed needs to be better documented. |
josephholsten
changed the title
Doc how to conver from logutils
Doc how to convert from logutils
Aug 12, 2017
how does this look for an updated usage section: package main
import (
"fmt"
"log"
"github.com/d2g/logfilter"
"github.com/d2g/logfilter/dummy"
)
func main() {
// Allow messages at warning and above
logfilter.Default(logfilter.Warning)
// Include logs from a package, set a lower level
logfilter.Include("github.com/d2g/logfilter/dummy").When(logfilter.Info)
// Exclude logs from a particularly noisy package
logfilter.Exclude("github.com/d2g/logfilter/noisy")
// Use "[WARN] " style prefixes, like logutils
// logfilter.SetParsers([]logfilter.Parser{logfilter.SqrParser})
// Unformatted log messages
log.Print("Message I haven't updated") // this will not print
// With logfilter prefix
log.Print("Trace: stdlib Tracing") // this will not print
log.Print("Debug: stdlib Debugging") // neither will this
log.Print("Info: stdlib Informing") // nor this
log.Print("Warning: stdlib Warning") // this will print
log.Print("Error: stdlib Erring") // so will this
log.Print("Fatal: stdlib Fatality") // and this
// Logging from a package
dummy.Unformatted() // this will not print
dummy.Trace() // neither will this
dummy.Debug() // nor this
dummy.Info() // this will print
dummy.Warning() // so will this
dummy.Error() // and this
dummy.Fatal() // and this
} Also, any ideas on how to get godoc2md to use a code block like: ```go ... ``` |
Let me know if you think that's enough. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two parts required to migrate from logutils:
[Level]
toLevel:
. Is there a way to to use the messages in logutils format?The text was updated successfully, but these errors were encountered: