Merge pull request #191 from yanmhlv/master

added custom logger and SetLogger function
bot-api-6.1
Syfaro 2018-08-27 15:38:41 -05:00 committed by GitHub
commit e21c866847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

1
bot.go
View File

@ -9,7 +9,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"

View File

@ -1,7 +1,6 @@
package tgbotapi
import (
"log"
"net/url"
)

17
log.go 100644
View 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
}