-
Starting from the default logger, it's pretty simple to discard all the logs: config := torrent.NewDefaultClientConfig()
config.Logger = log.Default
config.Logger.Handlers = []log.Handler{log.DiscardHandler} I can't quite get logging to a file to work, though: if file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0755); err == nil {
handler := log.DefaultHandler
handler.W = file
config.Logger.Handlers = []log.Handler{handler}
} |
Beta Was this translation helpful? Give feedback.
Answered by
FIGBERT
May 8, 2022
Replies: 2 comments 2 replies
-
Thanks I'll try this out and report back. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any updates? |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
FIGBERT
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any updates?