-
Notifications
You must be signed in to change notification settings - Fork 27
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
How to change default log level #46
Comments
Hey eloo, seems like there is currently no simple option to set the log level but you can create your own logger and then inject it via the package main
import (
"github.com/go-joe/joe"
"go.uber.org/zap"
)
func main() {
conf := zap.NewProductionConfig()
conf.Level = zap.NewAtomicLevelAt(zap.InfoLevel)
logger, err := conf.Build()
if err != nil {
panic(err)
}
b := joe.New("example-bot", joe.WithLogger(logger))
b.Respond("ping", Pong)
err = b.Run()
if err != nil {
b.Logger.Fatal(err.Error())
}
}
func Pong(msg joe.Message) error {
msg.Respond("PONG")
return nil
} |
I implemented a new Also starting with v0.11.0 the default log level is now info (not debug). |
That sounds good. |
Hi,
i'm just digging around how i can adjust the log level of the bot.
Maybe you can add a simple example how the log-level can be adjusted?
Thanks
The text was updated successfully, but these errors were encountered: