all repos — telegram-bot-api @ 9105c34c59802cba482ee90cae261218971f634c

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}