| Copyright | (c) Anton Gushcha, 2015-2016 |
|---|---|
| License | BSD3 |
| Maintainer | ncrashed@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Game.GoreAndAsh.Logging.State
Description
Contains description of state for logging core module.
- data LoggingState s = LoggingState {
- loggingMsgs :: !(Seq (LoggingLevel, Text))
- loggingNextState :: !s
- loggingFile :: !(Maybe Handle)
- loggingFilter :: !LoggingFilter
- loggignDebug :: !Bool
- data LoggingLevel
- data LoggingSink
- emptyLoggingState :: s -> LoggingState s
- filterLogMessage :: LoggingState s -> LoggingLevel -> LoggingSink -> Bool
Documentation
data LoggingState s Source
Inner state of logger.
s- next state, states of modules are chained via nesting
Constructors
| LoggingState | |
Fields
| |
Instances
| Generic (LoggingState s) Source | |
| NFData s => NFData (LoggingState s) Source | |
| Monad m => MonadState (LoggingState s) (LoggingT s m) | |
| type Rep (LoggingState s) Source |
data LoggingLevel Source
Describes important of logging message
Constructors
| LogDebug | Used for detailed logging |
| LogInfo | Used for messages about normal operation of application |
| LogWarn | Used for recoverable errors or defaulting to fallback behavior |
| LogError | Used before throwing an exception or fatal fales |
| LogMuted | Special case of message, that never goes to console, but saved into file |
data LoggingSink Source
Distanation of logging
Constructors
| LoggingConsole | Putting to user terminal |
| LoggingFile | Putting into file |
Instances
emptyLoggingState :: s -> LoggingState s Source
Create empty module state
filterLogMessage :: LoggingState s -> LoggingLevel -> LoggingSink -> Bool Source
Returns True if given message level is allowed to go in the sink