Contains combinators for chaining IO actions that can fail and log messages.
logLevelOf
:: LogEntry -> LogLevel
|
getLogLevel
:: IO LogLevel
Gets the global log level. |
setLogLevel
:: LogLevel -> IO ()
Sets the global log level. |
setWithShowTime
:: Bool -> IO ()
Sets the "show time" information. |
(|>=)
:: IO ([LogEntry],Either LogEntry a) -> (a -> IO ([LogEntry],Either LogEntry b)) -> IO ([LogEntry],Either LogEntry b)
Chains two actions passing the result from the first to the second. |
(|>)
:: IO ([LogEntry],Either LogEntry a) -> IO ([LogEntry],Either LogEntry b) -> IO ([LogEntry],Either LogEntry b)
Chains two actions ignoring the result of the first. |
(|->)
:: IO ([LogEntry],Either LogEntry a) -> IO ([LogEntry],Either LogEntry b) -> IO ([LogEntry],Either LogEntry a)
Chains two actions ignoring the result of the second. |
(|>>)
:: IO a -> IO ([LogEntry],Either LogEntry b) -> IO ([LogEntry],Either LogEntry b)
Chains a standard IO action (where the result is ignored) with an error logger action. |
mapEL
:: (a -> IO ([LogEntry],Either LogEntry b)) -> [a] -> IO ([LogEntry],Either LogEntry [b])
Maps an action over a list of values. |
foldEL
:: (a -> b -> IO ([LogEntry],Either LogEntry a)) -> a -> [b] -> IO ([LogEntry],Either LogEntry a)
Folds a list of values using an action. |
showLogEntry
:: LogEntry -> IO ()
Renders a log entry to stderr. |
levelGte
:: LogLevel -> LogLevel -> Bool
Compares two log levels. |
succeedIO
:: a -> IO ([LogEntry],Either LogEntry a)
Create an IO action that always succeeds. |
failIO
:: String -> IO ([LogEntry],Either LogEntry a)
Create an IO action that always fails. |
log
:: LogLevel -> String -> IO ([LogEntry],Either LogEntry ())
Create an IO action that logs a message. |
infoMessage
:: String -> IO ()
Prints an info message in the standard IO monad. |
debugMessage
:: String -> IO ()
Prints a debug message in the standard IO monad. |
errorMessage
:: String -> IO ()
Prints an error message in the standard IO monad. |
fromErrorLogger
:: IO ([LogEntry],Either LogEntry a) -> IO a
Transforms an error logger actions into a standard IO action. |
showExecCmd
:: String -> IO Int
Executes a system command and show the command as debug message. |
execQuietCmd
:: (String -> String) -> IO Int
Executes a parameterized system command. |
An error logger.
Type synonym: ErrorLogger a = ([LogEntry],Either LogEntry a)
A log entry.
Constructors:
A log level.
Constructors:
Quiet
:: LogLevel
Info
:: LogLevel
Debug
:: LogLevel
Error
:: LogLevel
Critical
:: LogLevel
|
Gets the global log level. Messages below this level will not be printed. |
Sets the global log level. Messages below this level will not be printed. |
Sets the "show time" information. If true, then timing information will be shown with every log information. |
Chains two actions passing the result from the first to the second.
|
Chains two actions ignoring the result of the first.
|
Chains two actions ignoring the result of the second.
|
Chains a standard IO action (where the result is ignored) with an error logger action.
|
Maps an action over a list of values. Fails if one of the actions fails. |
Folds a list of values using an action. Fails if one of the actions fails. |
Renders a log entry to stderr. |
Compares two log levels.
|
Create an IO action that logs a message. |
Prints an info message in the standard IO monad. |
Prints a debug message in the standard IO monad. |
Prints an error message in the standard IO monad. |
Transforms an error logger actions into a standard IO action. It shows all messages and, if the result is not available, exits with a non-zero code. |
Executes a system command and show the command as debug message. |
Executes a parameterized system command.
The parameter is set to |