diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2023-01-13 15:23:05 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-26 00:20:29 +0100 |
commit | 5b91c4a6bd542ca6e006ea36981b7f4120cc041e (patch) | |
tree | 1d3ab9aca658e3c9ba5682c657112fd309bff726 /widgets | |
parent | 3000c8262f69e2b04266be6ee08f1f5cb7c3f473 (diff) | |
download | aerc-5b91c4a6bd542ca6e006ea36981b7f4120cc041e.tar.gz |
status: print appropriate log message on push
Increase logging usability, by logging all messages pushed to status at
an appropriate loglevel.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/status.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/widgets/status.go b/widgets/status.go index 571fa8b0..67667016 100644 --- a/widgets/status.go +++ b/widgets/status.go @@ -70,6 +70,7 @@ func (status *StatusLine) SetError(text string) *StatusMessage { } func (status *StatusLine) Push(text string, expiry time.Duration) *StatusMessage { + log.Debugf(text) msg := &StatusMessage{ style: status.uiConfig().GetStyle(config.STYLE_STATUSLINE_DEFAULT), message: text, @@ -92,18 +93,21 @@ func (status *StatusLine) Push(text string, expiry time.Duration) *StatusMessage } func (status *StatusLine) PushError(text string) *StatusMessage { + log.Errorf(text) msg := status.Push(text, 10*time.Second) msg.Color(status.uiConfig().GetStyle(config.STYLE_STATUSLINE_ERROR)) return msg } func (status *StatusLine) PushWarning(text string) *StatusMessage { + log.Warnf(text) msg := status.Push(text, 10*time.Second) msg.Color(status.uiConfig().GetStyle(config.STYLE_STATUSLINE_WARNING)) return msg } func (status *StatusLine) PushSuccess(text string) *StatusMessage { + log.Tracef(text) msg := status.Push(text, 10*time.Second) msg.Color(status.uiConfig().GetStyle(config.STYLE_STATUSLINE_SUCCESS)) return msg |