| Copyright | Ondřej Šebek |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ondras98@icloud.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Swarm.Game.Log
Contents
Description
A data type to represent in-game logs by robots.
Because of the use of system robots, we sometimes want to use special kinds of logs that will be shown to the player.
TODO: #1039 Currently we abuse this system for system
logs, which is fun, but we should eventually make
a dedicated SystemLogEntry type for RuntimeState
message queue.
Synopsis
- data LogSource
- data ErrorLevel
- data LogEntry = LogEntry {
- _leTime :: Integer
- _leSource :: LogSource
- _leRobotName :: Text
- _leRobotID :: Int
- _leLocation :: Location
- _leText :: Text
- leText :: Lens' LogEntry Text
- leSource :: Lens' LogEntry LogSource
- leRobotName :: Lens' LogEntry Text
- leTime :: Lens' LogEntry Integer
- leLocation :: Lens' LogEntry Location
- leRobotID :: Lens' LogEntry Int
Documentation
Source of the robot log.
Constructors
| Said | Log produced by |
| Logged | Log produced by |
| ErrorTrace ErrorLevel | Log produced by an exception or system. |
Instances
| FromJSON LogSource Source # | |
| ToJSON LogSource Source # | |
Defined in Swarm.Game.Log | |
| Generic LogSource Source # | |
| Show LogSource Source # | |
| Eq LogSource Source # | |
| Ord LogSource Source # | |
| type Rep LogSource Source # | |
Defined in Swarm.Game.Log type Rep LogSource = D1 ('MetaData "LogSource" "Swarm.Game.Log" "swarm-0.3.0.0-DptGDjHvXlqJcJyQcOsuxZ" 'False) (C1 ('MetaCons "Said" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Logged" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorTrace" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorLevel)))) | |
data ErrorLevel Source #
Severity of the error - critical errors are bugs and should be reported as Issues.
Instances
Robot log entries
An entry in a robot's log.
Constructors
| LogEntry | |
Fields
| |