feat: add logger hook for standalone job logger

This commit is contained in:
fuxiaohei authored and Jason Song committed 2022-11-22 14:00:13 +08:00
1 parent a9298d936c
commit 0fa1fe0310
2 files changed
+24

No files matched your search

+3
View File
@@ -79,6 +79,9 @@ func WithJobLogger(ctx context.Context, jobID string, jobName string, config *Co
ctx = WithMasks(ctx, masks)
logger := logrus.New()
if hook := common.LoggerHook(ctx); hook != nil {
logger.AddHook(hook)
}
logger.SetFormatter(formatter)
logger.SetOutput(os.Stdout)
logger.SetLevel(logrus.GetLevel())