mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
telegramnotifier: show error message in the telegram log
This commit is contained in:
parent
1c23881da9
commit
7ef008dc4f
|
@ -34,6 +34,12 @@ func (t *LogHook) Fire(e *logrus.Entry) error {
|
|||
}
|
||||
|
||||
var message = fmt.Sprintf("[%s] %s", e.Level.String(), e.Message)
|
||||
if errData, ok := e.Data[logrus.ErrorKey]; ok {
|
||||
if err, isErr := errData.(error); isErr {
|
||||
message += " Error: " + err.Error()
|
||||
}
|
||||
}
|
||||
|
||||
t.notifier.Notify(message)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user