forked from gotomicro/ego
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [elog] mark printf and key-val paris method to deprecated
- Loading branch information
zhengwei
committed
Nov 22, 2021
1 parent
670c91f
commit 111d4af
Showing
3 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
package ecron | ||
|
||
import "github.com/gotomicro/ego/core/elog" | ||
import ( | ||
"github.com/gotomicro/ego/core/elog" | ||
) | ||
|
||
type wrappedLogger struct { | ||
*elog.Component | ||
} | ||
|
||
// Info logs routine messages about cron's operation. | ||
func (wl *wrappedLogger) Info(msg string, keysAndValues ...interface{}) { | ||
wl.Infow("cron "+msg, keysAndValues...) | ||
wl.Component.ZapSugaredLogger().Infow("cron "+msg, keysAndValues...) | ||
} | ||
|
||
// Error logs an error condition. | ||
func (wl *wrappedLogger) Error(err error, msg string, keysAndValues ...interface{}) { | ||
wl.Errorw("cron "+msg, append(keysAndValues, "err", err)...) | ||
wl.Component.ZapSugaredLogger().Errorw("cron "+msg, append(keysAndValues, "err", err)...) | ||
} |