Urgent.News

What's breaking now, across thousands of outlets.

Tech

deforester - Logging for Janet

I also made a r7rs scheme version (which lacks some things, due to portability/unfinished standard). Comments

Deforester is a logging library designed primarily for personal computing and local program execution, offering a file-writer capability that allows events to be printed unbuffered in web production systems. The library provides several bindings, including log, set-logger!, with-log-ctx, with-duration-logged, with-config, log*, as well as configuration helpers such as text-format and file-writer, file-writer-fast, and key-renamer. Users can even overwrite the :msg or :time fields for stable snapshot test results.

Deforester's primary advantage lies in its ability to facilitate the emission of high-quality events; however, the success of these events hinges on the consumer's taxonomy design, which dictates how events are named and what fields they contain. The library currently allows for the emission of basic events with fields for :time, :level, :msg, and domain information.

Additionally, it includes a with-duration-logged feature that can log :error messages, duration in milliseconds, and outcome, which can be either :success or :failure.

The library's approach to logging levels is somewhat unconventional, as it emphasizes the importance of attention and audience over strict filtering mechanisms. Deforester suggests that users consider using a multi-level system, such as :topic :audit, to keep category distinctions clear from attention levels. It also highlights the potential for incorporating additional levels as needed.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at codeberg.org →

More in Tech

More from Thursday 3 September →