tokenizer
This commit is contained in:
19
ai-chat-service/pkg/log/hook.go
Normal file
19
ai-chat-service/pkg/log/hook.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package log
|
||||
|
||||
import "github.com/sirupsen/logrus"
|
||||
import nativeLog "log"
|
||||
|
||||
type errorHook struct {
|
||||
}
|
||||
|
||||
func (*errorHook) Levels() []logrus.Level {
|
||||
return []logrus.Level{
|
||||
logrus.PanicLevel,
|
||||
logrus.FatalLevel,
|
||||
logrus.ErrorLevel,
|
||||
}
|
||||
}
|
||||
func (*errorHook) Fire(entry *logrus.Entry) error {
|
||||
nativeLog.Println(entry.Message, entry.Data)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user