om-logging: Opinionated logging utilities.

[ library, logging, mit ] [ Propose Tags ]

A set of logging combinators for use with monad-logger.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.1.0.4, 1.1.0.6, 1.1.0.7, 1.1.0.8
Dependencies aeson (>=2.0.3.0 && <2.3), base (>=4.15.1.0 && <4.20), bytestring (>=0.11.3.1 && <0.13), fast-logger (>=3.1.1 && <3.3), monad-logger (>=0.3.36 && <0.4), om-show (>=0.1.2.6 && <0.2), split (>=0.2.3.4 && <0.3), text (>=1.2.5.0 && <2.2), time (>=1.12.2 && <1.13) [details]
License MIT
Copyright 2021 Owens Murray, LLC.
Author Rick Owens
Maintainer rick@owensmurray.com
Category logging
Home page https://github.com/owensmurray/om-logging
Uploaded by rickowens at 2024-01-14T19:10:15Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 116 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for om-logging-1.1.0.8

[back to package description]

om-logging

This package provides various combinators for composing loggers for use with the monad-logger package.

It also provides an opinion about what a good log message looks like.

For instance, the opinionated "standard" log format is defined using the other combinators:

{- |
  Log to the indicated destination, applying the "standard" filters
  and formats.
-}
withStandardFormat
  :: LogLevel {- ^ The minimum log level that will be logged. -}
  -> (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) {- ^ The base logger. -}
  -> Loc
  -> LogSource
  -> LogLevel
  -> LogStr
  -> IO ()
withStandardFormat logLevel =
  filterLogging (levelFilter logLevel)
  . withPrefix ": "
  . withThread
  . withPackage
  . withLevel
  . withTime