Contains combinators for chaining IO actions that can fail and log messages.
logLevelOf
:: LogEntry -> LogLevel
|
printLogEntry
:: LogLevel -> LogEntry -> IO ()
Renders a log entry to stderr. |
levelGte
:: LogLevel -> LogLevel -> Bool
Compares two log levels. |
logAt
:: LogLevel -> String -> ErrorLogger ()
Logs a message at a user-defined level. |
logInfo
:: String -> ErrorLogger ()
Logs a message at the info level. |
logDebug
:: String -> ErrorLogger ()
Logs a message at the debug level. |
logError
:: String -> ErrorLogger ()
Logs a message at the error level. |
logCritical
:: String -> ErrorLogger ()
Logs a message at the critical level. |
putStrELM
:: String -> ErrorLogger ()
Prints a string in the ErrorLogger
monad.
|
putStrLnELM
:: String -> ErrorLogger ()
Prints a line in the ErrorLogger
monad.
|
fromErrorLogger
:: LogLevel -> Bool -> ErrorLogger a -> IO a
Transforms an error logger action into a standard IO action. |
fromErrorLoggerMsgs
:: LogLevel -> ErrorLogger a -> IO (String,Maybe a)
Transforms an error logger action into a standard IO action where all messages and the result (or Nothing
in case of a failure)
are returned.
|
getLogLevel
:: ErrorLogger LogLevel
Returns the current log level. |
setLogLevel
:: LogLevel -> ErrorLogger ()
Sets the current log level. |
getWithShowTime
:: ErrorLogger Bool
Returns the current time-showing mode. |
setWithShowTime
:: Bool -> ErrorLogger ()
Sets the current time-showing mode. |
liftIOEL
:: IO a -> ErrorLogger a
Lifts an IO action into the ErrorLogger
monad.
|
tryEL
:: Bool -> ErrorLogger a -> ErrorLogger (Either LogEntry a)
Tries to execute an EL action and returns either an error that occurred or the value. |
showExecCmd
:: String -> ErrorLogger Int
Executes a system command and shows the command as debug message. |
execQuietCmd
:: String -> String -> ErrorLogger Int
Executes a command depending on the verbosity mode. |
inDirectoryEL
:: String -> ErrorLogger a -> ErrorLogger a
Executes an EL action with the current directory set to a specific directory. |
inTempDirEL
:: ErrorLogger a -> ErrorLogger a
Executes an EL action with the current directory set to CPM's temporary directory. |
A log entry.
Constructors:
A log level.
Constructors:
Quiet
:: LogLevel
Info
:: LogLevel
Debug
:: LogLevel
Error
:: LogLevel
Critical
:: LogLevel
|
Renders a log entry to stderr. |
Compares two log levels.
|
Logs a message at a user-defined level. |
Logs a message at the info level. |
Logs a message at the debug level. |
Logs a message at the error level. |
Logs a message at the critical level. |
Prints a string in the |
Prints a line in the |
Transforms an error logger action into a standard IO action. It shows all messages and, if the result is not available, exits with a non-zero code. The first argument specifies the logging level for messages. If the second argument is true, timings are shown in the messages. |
Transforms an error logger action into a standard IO action
where all messages and the result (or |
Returns the current log level. |
Sets the current log level. |
Returns the current time-showing mode. |
Sets the current time-showing mode. |
Lifts an IO action into the |
Tries to execute an EL action and returns either an error that
occurred or the value. If the first argument is |
Executes a system command and shows the command as debug message. |
Executes a command depending on the verbosity mode.
If the log level is not |
Executes an EL action with the current directory set to a specific directory. |
Executes an EL action with the current directory set to CPM's temporary directory. |