co-log-simple: Simple enhancements for logging with co-log

[ library, logging, program ] [ Propose Tags ] [ Report a vulnerability ]

A library built upon co-log that makes constructing and using LogActions simpler with some predefined formatters and a slightly enhanced Severity type


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.2.1
Change log CHANGELOG.md
Dependencies ansi-terminal (>=1.0.2 && <2), base (>=3 && <5), co-log (>=0.7.0.0 && <0.8), co-log-core (>=0.3.2.1 && <0.4), co-log-simple, mtl (>=2.3.1 && <3), text (>=2.0.2 && <2.2), time (>=1.4 && <1.14) [details]
License ISC
Copyright 2025 Dino Morelli
Author Dino Morelli
Maintainer dino@ui3.info
Category Logging
Source repo head: git clone https://codeberg.org/dinofp/co-log-simple
Uploaded by DinoMorelli at 2025-09-10T21:02:11Z
Distributions
Reverse Dependencies 1 direct, 1 indirect [details]
Executables co-log-simple
Downloads 22 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-09-10 [all 1 reports]

Readme for co-log-simple-1.2.0

[back to package description]

co-log-simple

Synopsis

Simple enhancements for logging with co-log

Description

A library built upon co-log that makes constructing and using LogActions simpler with some predefined formatters and a slightly enhanced Severity type

This library expresses some logging needs that recur in my work:

  1. Often I want more than one type of "info" severity to differentiate between more- or less-chatty output that's not debug or warning/error related. This library includes a new Severity type that adds Notice between Info and Warning.
  2. I've often wanted different colors for severities which is much easier with co-log than hslogger
  3. This library also includes some functions for formatting different parts of a log message like the severity, stack info, or the message itself. These formatters can be composed together with the (%) and (%+) operators.

Additionally:

I found using the RichMsg/RichMessage types in co-log to be slightly on the complicated side to use. This library integrates timestamping through those types as well to make things easier while keeping the interface simple.

co-log-simple uses the ISO8601 with zone offset format for timestamps by default which I like because it sorts. The time formatters in this library also support custom format strings as defined in the Data.Time.Format module in the base time library.

For usage examples, see src/examples/Main.hs and the API docs for Colog.Simple

Development

Source code is available from Codeberg at the co-log-simple project page.

Handy command to generate Haddock docs during development if using stack. This constrains doc generation to modules in the library:

$ stack haddock --haddock --no-haddock-deps

Contact

Dino Morelli dino@ui3.info