logging

Simplified logging in IO for application writers.

LTS Haskell 23.18:3.0.6
Stackage Nightly 2025-04-19:3.0.6
Latest on Hackage:3.0.6

See all snapshots logging appears in

MIT licensed by John Wiegley, Roy Blankman
Maintained by [email protected]
This version can be pinned in stack with:logging-3.0.6@sha256:458420ca2d899b9bd1a8775d46948f14c080ccc5d10d4cae5fbe79d85ebf4ce0,2377

Module documentation for 3.0.6

logging is a wrapper around fast-logger which makes it easy to log from IO. It provides the following conveniences on top of those libraries:

  • A set of shorter functions to type: debug, log, warn, plus others that flush after each message, or which allow providing a message source string.

  • Logging variants of error, trace and traceShow, called errorL, traceL and traceShowL. These use unsafePerformIO in order to act as direct replacements, so the usual caveats apply.

  • A global function, setDebugLevel, which uses a global IORef to record the logging level, saving you from having to carry around the notion of "verbosity level" in a Reader environment.

  • A set of "timed" variants, timedLog and timedDebug, which report how long the specified action took to execute in wall-clock time.