This commit is contained in:
wangchuxiao 2023-03-13 10:14:02 +08:00
parent c7a8536278
commit 04068d25cb
4 changed files with 3 additions and 13 deletions

View File

@ -0,0 +1 @@
package log

View File

@ -23,12 +23,6 @@ func (f *fileHook) Levels() []logrus.Level {
return logrus.AllLevels
}
//func (f *fileHook) Fire(entry *logrus.Entry) error {
// entry.Map["FilePath"] = findCaller(6)
// utils.GetSelfFuncName()
// return nil
//}
func (f *fileHook) Fire(entry *logrus.Entry) error {
var s string
_, file, line, _ := runtime.Caller(8)

View File

@ -10,8 +10,4 @@ type Logger interface {
WithValues(keysAndValues ...interface{}) LogrusLogger
WithName(name string) LogrusLogger
WithCallDepth(depth int) LogrusLogger
WithItemSampler() LogrusLogger
// WithoutSampler returns the original logger without sampling
WithoutSampler() LogrusLogger
}

View File

@ -16,8 +16,8 @@ import (
"github.com/sirupsen/logrus"
)
var logger *LogrusLogger
var ctxLogger *LogrusLogger
var logger Logger = *LogrusLogger
var ctxLogger Logger = *LogrusLogger
type LogrusLogger struct {
*logrus.Logger
@ -32,7 +32,6 @@ func init() {
func NewPrivateLog(moduleName string) {
logger = loggerInit(moduleName)
ctxLogger = ctxLoggerInit(moduleName)
}
func ctxLoggerInit(moduleName string) *LogrusLogger {