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
Dependencies aeson (>=2.0.3.0 && <2.1), base (>=4.15.0.0 && <4.16), bytestring (>=0.10.12.1 && <0.11), fast-logger (>=3.1.1 && <3.2), monad-logger (>=0.3.36 && <0.4), om-show (>=0.1.2.0 && <0.2), split (>=0.2.3.4 && <0.3), text (>=1.2.5.0 && <1.3), time (>=1.9.3 && <1.10) [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 2022-10-11T02:54:31Z
Distributions NixOS:1.1.0.4
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 25 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2022-10-11 [all 2 reports]

Readme for om-logging-1.1.0.4

[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