added custom logger and SetLogger func
This commit is contained in:
parent
4c16a90966
commit
a1b3e41878
3 changed files with 17 additions and 2 deletions
17
log.go
Normal file
17
log.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue