added custom logger and SetLogger func

This commit is contained in:
Yan Mihailov 2018-08-07 00:15:37 +03:00
parent 4c16a90966
commit a1b3e41878
3 changed files with 17 additions and 2 deletions

17
log.go Normal file
View file

@ -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
}