gore-and-ash-logging-2.0.1.0: Core module for gore-and-ash with logging utilities

Copyright(c) Anton Gushcha, 2015-2016
LicenseBSD3
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Game.GoreAndAsh.Logging.State

Description

Contains description of state for logging core module.

Synopsis

Documentation

data LoggingState s Source

Inner state of logger.

s
next state, states of modules are chained via nesting

Constructors

LoggingState 

Fields

loggingMsgs :: !(Seq (LoggingLevel, Text))
 
loggingNextState :: !s
 
loggingFile :: !(Maybe Handle)
 
loggingFilter :: !LoggingFilter
 
loggignDebug :: !Bool
 

Instances

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

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