Skip to content

Commit

Permalink
finish event push to nsq
Browse files Browse the repository at this point in the history
  • Loading branch information
sols1st committed Mar 24, 2024
1 parent c44dedd commit 6e2d9e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions util/event-action.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ func (eh *eventActionHandler) Handle() model.EventLog {
} else {
eventLog = eh.createEventLog(createEventLogArgs{})
}
logger := Logger
logger := getLogger()
if producer := GetNSQProducer(); producer != nil {
logger.Hooks.Add(&NSQHookForError{
logger.Hooks.Add(&NSQHookForEvent{
Producer: producer,
})
}
Expand Down
4 changes: 2 additions & 2 deletions util/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func (hook *NSQHookForError) Fire(entry *logrus.Entry) error {
return hook.Producer.Publish("log_topic", byte)
}

// Levels 返回日志级别,这里只返回 ErrorLevel
// Levels 返回日志级别,这里返回 ErrorLevel,FatalLevel,PanicLevel
func (hook *NSQHookForError) Levels() []logrus.Level {
levels := [1]logrus.Level{logrus.ErrorLevel}
levels := [3]logrus.Level{logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel}
return levels[:]
}

Expand Down

0 comments on commit 6e2d9e9

Please sign in to comment.