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.API

Contents

Description

Module that contains monadic and arrow API of logging module.

Synopsis

Documentation

class MonadIO m => LoggingMonad m where Source

Low level API for module

Methods

putMsgM :: LoggingLevel -> Text -> m () Source

Put message to the console.

putMsgLnM :: LoggingLevel -> Text -> m () Source

Put message and new line to the console.

loggingSetHandle :: Handle -> m () Source

Setting current logging file handler

loggingSetFilter :: LoggingLevel -> [LoggingSink] -> m () Source

Setting allowed sinks for given logging level.

By default all messages are passed into file and console.

Instances

loggingSetFile Source

Arguments

:: LoggingMonad m 
=> FilePath

Path to logging file

-> Bool

If False, rewrites contents of the file, if True opens in append mode

-> m () 

Helper to set logging file as local path

Arrow API

logA :: LoggingMonad m => LoggingLevel -> GameWire m Text () Source

Put message to console on every frame without newline

logALn :: LoggingMonad m => LoggingLevel -> GameWire m Text () Source

Put message to console on every frame

logE :: LoggingMonad m => LoggingLevel -> GameWire m (Event Text) (Event ()) Source

Put message to console on event without newline

logELn :: LoggingMonad m => LoggingLevel -> GameWire m (Event Text) (Event ()) Source

Put message to console on event

Every frame

logDebugA :: LoggingMonad m => GameWire m Text () Source

Put info msg to console

logInfoA :: LoggingMonad m => GameWire m Text () Source

Put info msg to console

logWarnA :: LoggingMonad m => GameWire m Text () Source

Put warn msg to console

logErrorA :: LoggingMonad m => GameWire m Text () Source

Put error msg to console

Event based

logDebugE :: LoggingMonad m => GameWire m (Event Text) (Event ()) Source

Put info msg to console on event

logInfoE :: LoggingMonad m => GameWire m (Event Text) (Event ()) Source

Put info msg to console on event

logWarnE :: LoggingMonad m => GameWire m (Event Text) (Event ()) Source

Put warn msg to console on event

logErrorE :: LoggingMonad m => GameWire m (Event Text) (Event ()) Source

Put error msg to console on event

Event tracing

traceEvent :: LoggingMonad m => (a -> Text) -> GameWire m (Event a) (Event ()) Source

Prints event with given function

traceEventShow :: (TextShow a, LoggingMonad m) => GameWire m (Event a) (Event ()) Source

Prints event