df1

Type, render and parse the df1 hierarchical structured log format

https://github.com/k0001/di

Version on this page:0.4.2
LTS Haskell 22.43:0.4.3
Stackage Nightly 2024-12-04:0.4.3
Latest on Hackage:0.4.3

See all snapshots df1 appears in

BSD-3-Clause licensed by Renzo Carbonara
Maintained by renλren.zone
This version can be pinned in stack with:df1-0.4.2@sha256:d36152308aee97a913406946eda35ff473cc376d07bf61debd4e0c04c9d7b0c1,1104

Module documentation for 0.4.2

Used by 2 packages in lts-21.25(full list with versions):

df1

Hierarchical structured logging format. Easy for humans, fast for computers.

This library provides types, parsers and renderers for df1.

Consider this a preview release: The API is likely to stay stable, but extensive testing, formalization and tooling is due.

Build Status

See the BSD3 LICENSE file to learn about the legal terms and conditions for this library.

Changes

Version 0.4.2

  • Remove a lot of inlining to make compilation faster.

Version 0.4.1

  • Add ToPath, path.

  • Add ToValue instances for base’s Char, Fixed; for time’s SystemTime, UTCTime, CalendarDiffDays, CalendarDiffTime, Day, TimeZone, TimeOfDay, LocalTime, ZonedTime, NominalDiffTime, DiffTime, DayOfWeek.

  • Add ToSegment instances for base’s Char.

  • Add ToKey instances for base’s Char.

  • Add Read instance for Level.

Version 0.4

  • COMPILER ASSISTED BREAKING CHANGE: Change functions names Df1.render to Df1.Render.log, Df1.renderColor to Df1.Render.logColorANSI, and Df1.parse to Df1.Parse.log.

  • Exported key, message, iso8601, segment and value from module Df1.Render.

Version 0.3.2

  • Added ToValue instances for common types like Int, Bool, etc.

  • Changed colours in Log rendering.

Version 0.3.1

  • Added missing language pragma.

Version 0.3

  • The segment, key, value and message functions are now methods of the new ToSegment, ToKey, ToValue and ToMessage classes. Identity instances, as well as instances for String, lazy Text and strict Text, have been introduced for these classes.

Version 0.2

  • BREAKING CHANGE: Segment, Key, Value and Message don’t strip surrounding whitespace anymore. When rendering Segment, Key and Value, the whitespace will be percent-encoded. When rendering Message, the whitespace will be kept as is.

  • BREAKING CHANGE: Segment and Key now wrap lazy Text, rather than strict Text. This is to align their APIs with Value and Message, which already wrapped lazy Text so as to prevent logged Values and Messages from to use much memory. It’s unlikely that Segments and Keys are affected by this, since in practice they are almost always created statically. So, this change is mostly to make the API less surprising to users: Lazy Text is used throughout.

  • Added draft BNF specification.

Version 0.1.2

  • Fixed escaping of control characters in Message.

  • Percent-escape less punctuation characters when rendering Key, Segment and Value.

    TODO: write spec.

Version 0.1.1

  • Fixed compilation.

Version 0.1

  • Consider this a preview release: The API is likely to stay stable, but extensive testing, formalization and tooling is due.