heavy-logger-0.3.2.1: Full-weight logging based on fast-logger

Safe HaskellNone
LanguageHaskell2010

System.Log.Heavy.TH

Contents

Description

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.

Synopsis

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.

trace :: Q Exp Source #

TH macro to log a message with TRACE level. Usage:

$trace "hello, {}!" (Single name)

debug :: Q Exp Source #

TH macro to log a message with DEBUG level. Usage:

$debug "hello, {}!" (Single name)

info :: Q Exp Source #

TH macro to log a message with INFO level. Usage:

$info "hello, {}!" (Single name)

warning :: Q Exp Source #

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)

fatal :: Q Exp Source #

TH macro to log a message with FATAL level. Usage:

$fatal "Cannot establish database connection" ()

here :: Q Exp Source #

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

Orphan instances

Lift Priority Source # 
Instance details

Methods

lift :: Priority -> Q Exp #

Lift Level Source # 
Instance details

Methods

lift :: Level -> Q Exp #