monad-log-0.1.1.0: A simple and fast logging monad

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Log.LogLoc

Synopsis

Documentation

data LogLoc Source

source location information.

showt (LogLoc "package" Module "file.hs" 122) = "package Module file.hs 122"
toJSON (LogLoc "package" Module "file.hs" 122) =
    '{"package":"package","module":"module","filename":"file.hs","line":122}'

Constructors

LogLoc 

Fields

package :: Text
 
module' :: Text
 
filename :: Text
 
line :: Int
 

liftLogLoc :: Loc -> Q Exp Source

Lift a location into an Exp.

myLogLoc :: Q Exp Source

Get current LogLoc.

depending on how accurately you want to record source location, you may want to use Logger 's environment, or provide your own on every log.

example usage: info' $myLogLoc "log message"

withLogLoc :: MonadLog LogLoc m => LogLoc -> m a -> m a Source

withEnv specialized for LogLoc