Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains TemplateHaskell macros, that can be useful in many applications. In more complex applications, however, you probably will have to write your own adapter macros, which better suits your needs.
Documentation
putMessage :: Level -> Q Exp Source #
TH macro to put message to log. Usage:
$putMessage info_level "Received message #{}" (Single messageId)
Use ()
as last argument if you do not have variables.
This code will work in any monad that implements HasLogging
constraint.
TH macro to log a message with TRACE level. Usage:
$trace "hello, {}!" (Single name)
TH macro to log a message with DEBUG level. Usage:
$debug "hello, {}!" (Single name)
TH macro to log a message with INFO level. Usage:
$info "hello, {}!" (Single name)
TH macro to log a message with WARN level. Usage:
$warning "Beware the {}!" (Single name)
reportError :: Q Exp Source #
TH macro to log a message with ERROR level. Usage:
$reportError "Transaction #{} was declined." (Single transactionId)
TH macro to log a message with FATAL level. Usage:
$fatal "Cannot establish database connection" ()
TH macro to obtain current location in haskell source file.
Can be useful to construct LogMessage
structures 'by hand'.
thisModule :: Q Exp Source #
TH macro to obtain current module name in form of LogSource
.
Can be useful to construct LogMessage
structures 'by hand'.