all repos — telegram-bot-api @ 3fbd77ce76edcd2f439f1f961d22c0ffeb02d927

Golang bindings for the Telegram Bot API

log.go (view raw)

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