A log message (just a string for now).
Equations
Instances For
An opaque handle to a running logger set.
The mutex-protected buffer.
The flush action (writes buffered content to destination).
- bufSize : Nat
Maximum buffer size before auto-flush.
Instances For
Flush all buffered messages to the destination. $$\text{flushLogStr} : \text{LoggerSet} \to \text{IO Unit}$$
Equations
- One or more equations did not get rendered due to their size.
Instances For
Push a log message to the logger. May trigger an auto-flush if the
buffer exceeds bufSize.
$$\text{pushLogStr} : \text{LoggerSet} \to \text{LogStr} \to \text{IO Unit}$$
Equations
- One or more equations did not get rendered due to their size.
Instances For
Close the logger: flush remaining messages. $$\text{rmLoggerSet} : \text{LoggerSet} \to \text{IO Unit}$$
Equations
Instances For
Convenience: create a timed logger that prepends timestamps. Uses AutoUpdate to cache the current time (updated once per second). $$\text{withTimedFastLogger} : \text{LogType} \to (\text{LoggerSet} \to \text{IO}\ \alpha) \to \text{IO}\ \alpha$$
Equations
- System.Log.FastLogger.withTimedFastLogger logType action = do let logger ← System.Log.FastLogger.newLoggerSet logType tryFinally (action logger) (System.Log.FastLogger.rmLoggerSet logger)