Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data LogDestination
- data LogLevel
- initLogger :: Q Exp
- initLoggerAllPackages :: Q Exp
- setLoggingDestination :: String -> LogDestination -> LogFromAllPackages -> IO ()
- setMinLogLevel :: LogLevel -> IO ()
- setPrintLocationToConsole :: Bool -> IO ()
- logAll :: Q Exp
- logPrintAll :: Q Exp
- logDebug :: Q Exp
- logPrintDebug :: Q Exp
- logInfo :: Q Exp
- logPrintInfo :: Q Exp
- logWarning :: Q Exp
- logPrintWarning :: Q Exp
- logError :: Q Exp
- logPrintError :: Q Exp
- pureLogAll :: Q Exp
- pureLogPrintAll :: Q Exp
- pureLogDebug :: Q Exp
- pureLogPrintDebug :: Q Exp
- pureLogInfo :: Q Exp
- pureLogPrintInfo :: Q Exp
- pureLogWarning :: Q Exp
- pureLogPrintWarning :: Q Exp
- pureLogError :: Q Exp
- pureLogPrintError :: Q Exp
- logAllText :: Q Exp
- logPrintAllText :: Q Exp
- logDebugText :: Q Exp
- logPrintDebugText :: Q Exp
- logInfoText :: Q Exp
- logPrintInfoText :: Q Exp
- logWarningText :: Q Exp
- logPrintWarningText :: Q Exp
- logErrorText :: Q Exp
- logPrintErrorText :: Q Exp
- pureLogAllText :: Q Exp
- pureLogPrintAllText :: Q Exp
- pureLogDebugText :: Q Exp
- pureLogPrintDebugText :: Q Exp
- pureLogInfoText :: Q Exp
- pureLogPrintInfoText :: Q Exp
- pureLogWarningText :: Q Exp
- pureLogPrintWarningText :: Q Exp
- pureLogErrorText :: Q Exp
- pureLogPrintErrorText :: Q Exp
- finalizeAllLoggers :: IO ()
- finalizeLogger :: Q Exp
- flushLoggers :: IO ()
Documentation
data LogDestination Source #
Logging destination. See also setLoggingDestination
.
Log Level. Levels are sorted. All
< Debug
< Info
< Warning
< Error
. None disables all logging. Default: All
Instances
Bounded LogLevel Source # | |
Enum LogLevel Source # | |
Eq LogLevel Source # | |
Ord LogLevel Source # | |
Defined in EasyLogger.Logger | |
Read LogLevel Source # | |
Show LogLevel Source # | |
initLogger :: Q Exp Source #
Initialise the logger. MUST only be called in the executable code (not the exposed library code)! Ignores the other packages logs, if the same packages is used for logging.
initLoggerAllPackages :: Q Exp Source #
Initialise the logger. MUST only be called in the executable code (not the exposed library code)! Takes a Bool
that decides wether to log messages from other packages that use the same library
and did not initalize the Logger (which should be the case for all of them!).
setLoggingDestination :: String -> LogDestination -> LogFromAllPackages -> IO () Source #
Set the destination for all consequitive for logging. You should only set this once, at the beginning of the program! The default is LogStdOut
.
setMinLogLevel :: LogLevel -> IO () Source #
Set the least logging level. Levels lower will not be logged. Log Level Order: Debug
< Info
< Warning
< Error
. None
disables all logging. Note that the output to stderr using e.g. logPrintError
will not
be affected!
setPrintLocationToConsole :: Bool -> IO () Source #
Set the least logging level. Levels lower will not be logged. Log Level Order: Debug
< Info
< Warning
< Error
. None
disables all logging. Note that the output to stderr using e.g. logPrintError
will not
be affected!
Generates a function that takes a Text
and logs a LevelAll
message. Usage:
$(logAll) ("This is a debug log message" :: T.Text)
Generates a function that takes a Text
and logs a LevelDebug
message. Usage:
$(logDebug) "This is a debug log message"
Generates a function that takes a Text
and logs a LevelInfo
message. Usage:
$(logInfo) "This is a info log message"
logWarning :: Q Exp Source #
Generates a function that takes a Text
and logs a LevelWarning
message. Usage:
$(logWarning) "This is a warning log message"
logPrintWarning :: Q Exp Source #
Same as logWarning
, but also prints the message on stdout
.
Generates a function that takes a Text
and logs a LevelError
message. Usage:
$(logError) "This is a error log message"
pureLogAll :: Q Exp Source #
Same as logAll
, but for pure code. Uses unsafePerformIO
.
$(pureLogAll) "This is a debug log message" (3 * 3)
pureLogPrintAll :: Q Exp Source #
Same as pureLogAll
, but also prints the message on stdout
.
$(pureLogPrintAll) "This is a debug log message" (3 * 3)
pureLogDebug :: Q Exp Source #
Same as logDebug
, but for pure code. Uses unsafePerformIO
$(pureLogDebug) "This is a debug log message" defaultValue
pureLogPrintDebug :: Q Exp Source #
Same as pureLogDebug
, but also prints the message on stdout
.
$(purePrintLogDebug) "This is a debug log message" defaultValue
pureLogInfo :: Q Exp Source #
Same as logInfo
, but for pure code. Uses unsafePerformIO
.
$(pureLogInfo) "This is a warning log message" (funcX 10)
pureLogPrintInfo :: Q Exp Source #
Same as pureLogInfo
, but also prints the message on stdout
.
$(pureLogPrintInfo) "This is a warning log message" (funcX 10)
pureLogWarning :: Q Exp Source #
Same as logWarning
, but for pure code. Uses unsafePerformIO
.
$(pureLogWarning) "This is a warning log message" "myresult"
pureLogPrintWarning :: Q Exp Source #
Same as pureLogWarning
, but also prints the warning.
$(pureLogPrintWarning) "This is a error log message" (4 + 4)
pureLogError :: Q Exp Source #
Same as logError
, but for pure code. Uses unsafePerformIO
.
$(pureLogError) "This is a error log message" (4 + 4)
pureLogPrintError :: Q Exp Source #
Same as pureLogError
, but also prints the message on stderr
.
$(pureLogPrintError) "This is a error log message" (4 + 4)
logAllText :: Q Exp Source #
Same as logAll, but with concrete type Text
as message.
$(logAll) "This is a debug log message"
logPrintAllText :: Q Exp Source #
logPrintDebugText :: Q Exp Source #
logWarningText :: Q Exp Source #
Same as logWarning
but with Text
as fixed message type.
logPrintWarningText :: Q Exp Source #
Same as logWarning
, but also prints the message on stdout
.
pureLogAllText :: Q Exp Source #
Same as pureLogAll
, but with concrete type Text
as message.
pureLogPrintAllText :: Q Exp Source #
Same as pureLogPrintAll
, but with concrete type Text
as log message.
pureLogDebugText :: Q Exp Source #
Same as pureLogDebug
, but with concrete type Text
as message.
pureLogPrintDebugText :: Q Exp Source #
Same as pureLogPrintDebug
, but with concrete type Text
as log message.
pureLogInfoText :: Q Exp Source #
Same as pureLogInfo
, but with concrete type Text
as message.
pureLogPrintInfoText :: Q Exp Source #
Same as pureLogPrintInfo
, but with concrete type Text
as log message.
pureLogWarningText :: Q Exp Source #
Same as pureLogWarning
, but with concrete type Text
as message.
pureLogPrintWarningText :: Q Exp Source #
Same as pureLogPrintWarning
, but with concrete type Text
as log message.
pureLogErrorText :: Q Exp Source #
Same as pureLogError
, but with concrete type Text
as message.
pureLogPrintErrorText :: Q Exp Source #
Same as pureLogPrintError
, but with concrete type Text
as log message.
finalizeAllLoggers :: IO () Source #
Should be used to ensure all logs are completely written before the program exists. Cleans all the file descriptors. You (and also no other library) MUST NOT log after this command as all loggers are deinitalized. However, you might initialize the loggers again and before restarting to log.
finalizeLogger :: Q Exp Source #
Can be used to destroy your own logger (from your package) only. You MUST NOT log after this command.
flushLoggers :: IO () Source #
Flush all loggers of all packages.