all repos — telegram-bot-api @ 898e79fe47dafa598b3f61dd570aa2921628e530

Golang bindings for the Telegram Bot API

log.go (view raw)

 1package tgbotapi
 2
 3import (
 4	"errors"
 5	stdlog "log"
 6	"os"
 7)
 8
 9var log = stdlog.New(os.Stderr, "", stdlog.LstdFlags)
10
11// SetLogger specifies the logger that the package should use.
12func SetLogger(newLog *stdlog.Logger) error {
13	if newLog == nil {
14		return errors.New("logger is nil")
15	}
16	log = newLog
17	return nil
18}