fast-logger-2.0.0: A fast logging system

Safe HaskellNone




Creating a logger set

data LoggerSet Source

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.

type BufSize = IntSource

The type for buffer size of each core.

defaultBufSize :: BufSizeSource

The default buffer size (4,096 bytes).

logOpen :: FilePath -> IO FDSource

Opening a log file. FIXME: Windows support.

newLoggerSet :: BufSize -> FD -> IO LoggerSetSource

Creating a new LoggerSet.

renewLoggerSet :: LoggerSet -> FD -> IO ()Source

Renewing FD in LoggerSet. Old FD is closed.

Removing a logger set

rmLoggerSet :: LoggerSet -> IO ()Source

Flushing the buffers, closing FD and freeing the buffers.

Log messages

data LogStr Source

Log message builder. Use (<>) to append two LogStr in O(1).

logStrLength :: LogStr -> IntSource

Obtaining the length of LogStr.

Writing a log message

pushLogStr :: LoggerSet -> LogStr -> IO ()Source

Writing a log message to the corresponding buffer.

Flushing buffered log messages

flushLogStr :: LoggerSet -> IO ()Source

Flushing log messages in buffers.

File rotation