Contains combinators for chaining IO actions that can fail and log messages.
logLevelOf
:: LogEntry -> LogLevel
|
showLogEntry
:: 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. |
showExecCmd
:: String -> ErrorLogger Int
Executes a system command and show the command as debug message. |
execQuietCmd
:: (String -> String) -> ErrorLogger Int
Executes a parameterized system command. |
getLogLevel
:: ErrorLogger LogLevel
|
getWithShowTime
:: ErrorLogger Bool
|
setLogLevel
:: LogLevel -> ErrorLogger ()
|
setWithShowTime
:: Bool -> ErrorLogger ()
|
liftIOEL
:: IO a -> ErrorLogger a
|
tryEL
:: ErrorLogger a -> ErrorLogger (Either LogEntry a)
Tries to execute an EL action and returns either an error that occurred or the value. |
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. |
Executes a system command and show the command as debug message. |
Executes a parameterized system command.
The parameter is set to |
|
|
|
|
Tries to execute an EL action and returns either an error that occurred or the value. |
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. |