-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend logs for warnings #982
Conversation
@@ -109,8 +109,8 @@ handleEvent = \case | |||
AppEvent (UpstreamVersion ev) -> do | |||
let logReleaseEvent l e = runtimeState . eventLog %= logEvent l ("Release", -7) (T.pack $ show e) | |||
case ev of | |||
Left e@(FailedReleaseQuery _e) -> logReleaseEvent ErrorTrace e | |||
Left e -> logReleaseEvent Said e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
-- ^ The ID of the robot that generated the entry. | ||
, _leLocation :: Location | ||
-- ^ Location of the robot at log entry creation. | ||
, _leText :: Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At #959 (comment) we discussed maybe storing something more structured here than just a Text
, which I think is worth exploring. But we should probably leave that to a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to split a separate type for system logs which should also use structured errors.
I think that will make the design clear, now it's all tangled and adding anything to it would be a mistake IMO.
* split logs into separate module * make some logs warnings and fatal (to be continued...) * prepare failure logging infrastructure for TUI
Co-authored-by: Brent Yorgey <byorgey@gmail.com>
|
||
-- | An entry in a robot's log. | ||
data LogEntry = LogEntry | ||
{ _leTime :: Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fields sound French 😜
closes #1115 This PR makes use of the rich types defined in #982 and converts many functions of `Has (Throw Text)` type to `ExceptT`. It also logs a warning instead of crashing with terminal failure if "save" info cannot be loaded, which will be important for #974 where the save file schema changes. ![Screenshot from 2023-02-18 13-22-16](https://user-images.githubusercontent.com/261693/219901189-c9d97fca-698a-4080-84fc-0b4110d3a601.png)
This should be merged before #954 so it is not squashed.