easy-logger-0.1.0.7: Logging made easy.
Safe HaskellNone
LanguageHaskell2010

EasyLogger.Logger

Synopsis

Documentation

data LogDestination Source #

Logging destination. See also setLoggingDestination.

data LogLevel Source #

Log Level. Levels are sorted. All < Debug < Info < Warning < Error. None disables all logging. Default: All

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!

logAll :: Q Exp Source #

Generates a function that takes a Text and logs a LevelAll message. Usage:

$(logAll) ("This is a debug log message" :: T.Text)

logPrintAll :: Q Exp Source #

Same as logAll, but also prints the message on stdout.

logDebug :: Q Exp Source #

Generates a function that takes a Text and logs a LevelDebug message. Usage:

$(logDebug) "This is a debug log message"

logPrintDebug :: Q Exp Source #

Same as logDebug, but also prints the message on stdout.

logInfo :: Q Exp Source #

Generates a function that takes a Text and logs a LevelInfo message. Usage:

$(logInfo) "This is a info log message"

logPrintInfo :: Q Exp Source #

Same as logInfo, but also prints the message on stdout.

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.

logError :: Q Exp Source #

Generates a function that takes a Text and logs a LevelError message. Usage:

$(logError) "This is a error log message"

logPrintError :: Q Exp Source #

Same as logError, but also prints the message on stderr.

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 #

Same as logAll, but also prints the message on stdout. Only for Text.

logDebugText :: Q Exp Source #

Same as logDebug but with Text as fixed message type.

logPrintDebugText :: Q Exp Source #

Same as logDebug, but also prints the message on stdout. Only for Text.

logInfoText :: Q Exp Source #

Same as logInfo but with Text as fixed message type.

logPrintInfoText :: Q Exp Source #

Same as logInfo, but also prints the message on stdout.

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.

logErrorText :: Q Exp Source #

Same as logError but with Text as fixed message type.

logPrintErrorText :: Q Exp Source #

Same as logError, but also prints the message on stderr.

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.