Skip to content

Commit

Permalink
feat: remove unauthorised error from log
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Jan 3, 2024
1 parent d9fa20a commit ddfcd4a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/lib/libapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,16 @@ func initLogger(id, name, version, dataPath string, logLevel libzap.Level) {
func GetLogger() log.Logger {
fuzzyStr := "***"
return log.NewFilter(log.GetLogger(),
log.FilterKey("password"),
log.FilterFunc(
func(level log.Level, keyvals ...interface{}) bool {
for i := 0; i < len(keyvals); i += 2 {
if keyvals[i] == "reason" && keyvals[i+1] == "UNAUTHORISED" {
return true
}
}
return false
},
),
log.FilterFunc(
func(level log.Level, keyvals ...interface{}) bool {
for i := 0; i < len(keyvals); i++ {
Expand Down

0 comments on commit ddfcd4a

Please sign in to comment.