service graceful shutdown

This commit is contained in:
ginuerzh
2025-01-08 23:12:06 +08:00
parent eef3bd7f25
commit 489a762811
4 changed files with 33 additions and 9 deletions
+6 -1
View File
@@ -84,9 +84,14 @@ func NewLogger(opts ...Option) logger.Logger {
log.SetLevel(logrus.InfoLevel)
}
return &logrusLogger{
l := &logrusLogger{
logger: logrus.NewEntry(log),
}
if options.Name != "" {
l.logger = l.logger.WithField("logger", options.Name)
}
return l
}
// WithFields adds new fields to log.