fermentord/vendor/github.com/JuulLabs-OSS/cbgo/bt.go
Søren Rasmussen 07a23c1845
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Upgrade to go 1.20 and add vendor catalog
2023-04-22 10:37:23 +02:00

28 lines
513 B
Go

package cbgo
import (
"os"
"github.com/sirupsen/logrus"
)
var btlog = &logrus.Logger{
Out: os.Stderr,
Formatter: &logrus.TextFormatter{
FullTimestamp: true,
TimestampFormat: "2006-01-02 15:04:05.999",
},
Level: logrus.ErrorLevel,
}
// SetLog replaces the cbgo logger with a custom one.
func SetLog(log *logrus.Logger) {
btlog = log
}
// SetLogLevel configures the cbgo logger to use the specified log level.
func SetLogLevel(level logrus.Level) {
if btlog != nil {
btlog.SetLevel(level)
}
}