fast-logger-0.2.0: A fast logging system

Safe HaskellSafe-Infered




Fast logging system to copy log data directly to Handle buffer.



data Logger Source

Abstract data type for logger.



:: Bool

Automatically flush on each loggerPut?

-> Handle

If Handle is associated with a file, AppendMode must be used.

-> IO Logger 

Creates a Logger from the given handle.

renewLogger :: Logger -> Handle -> IO LoggerSource

Creates a new Logger from old one by replacing Handle. The new Handle automatically inherits the file mode of the old one. The old Handle is automatically closed.


loggerPutStr :: Logger -> [LogStr] -> IO ()Source

The hPut function to copy a list of LogStr to the buffer of Handle of Logger directly.

loggerPutBuilder :: Logger -> Builder -> IO ()Source

The hPut function directory to copy Builder to the buffer. The current implementation is inefficient at this moment. This would replace loggerPutStr someday.

loggerFlush :: Logger -> IO ()Source

Flushing the buffer of Handle of Logger.


data LogStr Source

A date type to contain String and ByteString. This data is exported so that format can be defined. This would be replaced with Builder someday when it can be written directly to Handle buffer.


LS !String 
LB !ByteString 

Misc functions

loggerDate :: Logger -> IO ZonedDateSource

Obtaining date string from Logger.

File rotation