monad-log-0.1.1.0: A simple and fast logging monad
Control.Monad.Log.LogLoc
Synopsis
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
Fields
Instances
liftLogLoc :: Loc -> Q Exp Source
Lift a location into an Exp.
myLogLoc :: Q Exp Source
Get current LogLoc.
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.
Logger
example usage: info' $myLogLoc "log message"
info' $myLogLoc "log message"
withLogLoc :: MonadLog LogLoc m => LogLoc -> m a -> m a Source
withEnv specialized for LogLoc
withEnv