monadlog-0.1.1.1: 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
Methods
(==) :: LogLoc -> LogLoc -> Bool #
(/=) :: LogLoc -> LogLoc -> Bool #
compare :: LogLoc -> LogLoc -> Ordering #
(<) :: LogLoc -> LogLoc -> Bool #
(<=) :: LogLoc -> LogLoc -> Bool #
(>) :: LogLoc -> LogLoc -> Bool #
(>=) :: LogLoc -> LogLoc -> Bool #
max :: LogLoc -> LogLoc -> LogLoc #
min :: LogLoc -> LogLoc -> LogLoc #
showsPrec :: Int -> LogLoc -> ShowS #
show :: LogLoc -> String #
showList :: [LogLoc] -> ShowS #
parseJSON :: Value -> Parser LogLoc #
parseJSONList :: Value -> Parser [LogLoc] #
toJSON :: LogLoc -> Value #
toEncoding :: LogLoc -> Encoding #
toJSONList :: [LogLoc] -> Value #
toEncodingList :: [LogLoc] -> Encoding #
showbPrec :: Int -> LogLoc -> Builder #
showb :: LogLoc -> Builder #
showbList :: [LogLoc] -> Builder #
showtPrec :: Int -> LogLoc -> Text #
showt :: LogLoc -> Text #
showtList :: [LogLoc] -> Text #
showtlPrec :: Int -> LogLoc -> Text #
showtl :: LogLoc -> Text #
showtlList :: [LogLoc] -> Text #
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