Merge pull request #191 from yanmhlv/master added custom logger and SetLogger function
Syfaro syfaro@huefox.com
Mon, 27 Aug 2018 15:38:41 -0500
3 files changed,
17 insertions(+),
2 deletions(-)
A
log.go
@@ -0,0 +1,17 @@
+package tgbotapi + +import ( + "os" + "errors" + stdlog "log" +) + +var log = stdlog.New(os.Stderr, "", stdlog.LstdFlags) + +func SetLogger(newLog *stdlog.Logger) error { + if newLog == nil { + return errors.New("logger is nil") + } + log = newLog + return nil +}