logging-facade-0.3.1: Simple logging abstraction that allows multiple back-ends

Safe Haskell | None
Language | Haskell2010

System.Logging.Facade.Sink

Synopsis

- type LogSink = LogRecord -> IO ()
- defaultLogSink :: IO LogSink
- getLogSink :: IO LogSink
- setLogSink :: LogSink -> IO ()
- swapLogSink :: LogSink -> IO LogSink
- withLogSink :: LogSink -> IO () -> IO ()

# Documentation

type LogSink = LogRecord -> IO () Source #

A consumer for log records

defaultLogSink :: IO LogSink Source #

A thread-safe log sink that writes log messages to `stderr`

getLogSink :: IO LogSink Source #

Return the global log sink.

setLogSink :: LogSink -> IO () Source #

Set the global log sink.

swapLogSink :: LogSink -> IO LogSink Source #

Return the global log sink and set it to a new value in one atomic operation.

withLogSink :: LogSink -> IO () -> IO () Source #

Set the global log sink to a specified value, run given action, and finally restore the global log sink to its previous value.