diff --git a/pkg/common/log/ctx_logrus.go b/pkg/common/log/ctx_logrus.go new file mode 100644 index 000000000..7330d5405 --- /dev/null +++ b/pkg/common/log/ctx_logrus.go @@ -0,0 +1 @@ +package log diff --git a/pkg/common/log/file_line_hk.go b/pkg/common/log/file_line_hk.go index be194e43a..c52aefbf1 100644 --- a/pkg/common/log/file_line_hk.go +++ b/pkg/common/log/file_line_hk.go @@ -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) diff --git a/pkg/common/log/logger.go b/pkg/common/log/logger.go index b00ddbb5e..a2a637b6e 100644 --- a/pkg/common/log/logger.go +++ b/pkg/common/log/logger.go @@ -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 } diff --git a/pkg/common/log/logrus.go b/pkg/common/log/logrus.go index 46e7b3f91..f77e2e54e 100644 --- a/pkg/common/log/logrus.go +++ b/pkg/common/log/logrus.go @@ -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 {