added custom logger and SetLogger func
Yan Mihailov yanmhlv@gmail.com
Tue, 07 Aug 2018 00:15:37 +0300
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 +}