Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LoggerSet
- newFileLoggerSet :: BufSize -> FilePath -> IO LoggerSet
- newStdoutLoggerSet :: BufSize -> IO LoggerSet
- newStderrLoggerSet :: BufSize -> IO LoggerSet
- newLoggerSet :: BufSize -> Maybe FilePath -> IO LoggerSet
- renewLoggerSet :: LoggerSet -> IO ()
- rmLoggerSet :: LoggerSet -> IO ()
- pushLogStr :: LoggerSet -> LogStr -> IO ()
- pushLogStrLn :: LoggerSet -> LogStr -> IO ()
- flushLogStr :: LoggerSet -> IO ()
- replaceLoggerSet :: LoggerSet -> FilePath -> (LoggerSet, Maybe FilePath)
Creating a logger set
A set of loggers. The number of loggers is the capabilities of GHC RTS. You can specify it with "+RTS -N<x>". A buffer is prepared for each capability.
newFileLoggerSet :: BufSize -> FilePath -> IO LoggerSet Source #
Creating a new LoggerSet
using a file.
Renewing and removing a logger set
renewLoggerSet :: LoggerSet -> IO () Source #
Renewing the internal file information in LoggerSet
.
This does nothing for stdout and stderr.
rmLoggerSet :: LoggerSet -> IO () Source #
Flushing the buffers, closing the internal file information and freeing the buffers.
Writing a log message
pushLogStr :: LoggerSet -> LogStr -> IO () Source #
Writing a log message to the corresponding buffer. If the buffer becomes full, the log messages in the buffer are written to its corresponding file, stdout, or stderr.
pushLogStrLn :: LoggerSet -> LogStr -> IO () Source #
Same as pushLogStr
but also appends a newline.
Flushing buffered log messages
flushLogStr :: LoggerSet -> IO () Source #
Flushing log messages in buffers. This function must be called explicitly when the program is being terminated.
Note: Since version 2.1.6, this function does not need to be explicitly called, as every push includes an auto-debounced flush courtesy of the auto-update package. Since version 2.2.2, this function can be used to force flushing outside of the debounced flush calls.