fast-logger-2.1.2: A fast logging system

Safe HaskellNone

System.Log.FastLogger

Contents

Synopsis

Creating a logger set

type BufSize = IntSource

The type for buffer size of each core.

defaultBufSize :: BufSizeSource

The default buffer size (4,096 bytes).

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.

newLoggerSet :: BufSize -> Maybe FilePath -> IO LoggerSetSource

Creating a new LoggerSet. If Nothing is specified to the second argument, stdout is used. Please note that the minimum BufSize is 1.

renewLoggerSet :: LoggerSet -> IO ()Source

Renewing the internal file information in LoggerSet.

Removing a logger set

rmLoggerSet :: LoggerSet -> IO ()Source

Flushing the buffers, closing the internal file information 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