write alerts to log in debug mode
This commit is contained in:
parent
e15cca7db8
commit
85c8b222a0
2 changed files with 9 additions and 1 deletions
|
@ -120,6 +120,12 @@ renderAlertMessage :: Alert -> Text
|
||||||
renderAlertMessage alert = renderTense (alertTense alert) $
|
renderAlertMessage alert = renderTense (alertTense alert) $
|
||||||
(alertMessageRender alert) (alertData alert)
|
(alertMessageRender alert) (alertData alert)
|
||||||
|
|
||||||
|
showAlert :: Alert -> String
|
||||||
|
showAlert alert = T.unpack $ T.unwords $ catMaybes
|
||||||
|
[ renderAlertHeader alert
|
||||||
|
, Just $ renderAlertMessage alert
|
||||||
|
]
|
||||||
|
|
||||||
alertTense :: Alert -> Tense
|
alertTense :: Alert -> Tense
|
||||||
alertTense alert
|
alertTense alert
|
||||||
| alertClass alert == Activity = Present
|
| alertClass alert == Activity = Present
|
||||||
|
|
|
@ -186,7 +186,9 @@ notifyAlert = do
|
||||||
|
|
||||||
{- Returns the alert's identifier, which can be used to remove it. -}
|
{- Returns the alert's identifier, which can be used to remove it. -}
|
||||||
addAlert :: Alert -> Assistant AlertId
|
addAlert :: Alert -> Assistant AlertId
|
||||||
addAlert alert = notifyAlert `after` modifyDaemonStatus add
|
addAlert alert = do
|
||||||
|
debug [showAlert alert]
|
||||||
|
notifyAlert `after` modifyDaemonStatus add
|
||||||
where
|
where
|
||||||
add s = (s { lastAlertId = i, alertMap = m }, i)
|
add s = (s { lastAlertId = i, alertMap = m }, i)
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue