telegram-bot-api/log.go

19 lines
312 B
Go
Raw Normal View History

2018-08-06 23:15:37 +02:00
package tgbotapi
import (
"errors"
stdlog "log"
"os"
2018-08-06 23:15:37 +02:00
)
var log = stdlog.New(os.Stderr, "", stdlog.LstdFlags)
// SetLogger specifies the logger that the package should use.
2018-08-06 23:15:37 +02:00
func SetLogger(newLog *stdlog.Logger) error {
if newLog == nil {
return errors.New("logger is nil")
}
log = newLog
return nil
}