martosaur

martosaur

I’m excited to announce LoggerHandlerKit – an educational package for developers who want to write their own logger handler. It provides:

  1. An example test suite for the default Elixir logger
  2. A collection of test helpers, including test cases
  3. Docs and code comments to help you through :folded_hands:

The package gives developers a clear scope of test cases to implement and offers guidance along the way. Once all tests pass, you should have a good grasp of how handlers work and your logger handler should be… well, good. Or at least it will be able to handle a large variety of log events and have a solid test suite, it can still be bad in its own unique way :heart:

Right now it covers the core handler functionality and touches on Logger.Translator’s role, but I’m planning to add guides about other aspects too – things like overload protection and encoding/serialization.

To showcase how using LoggerHandlerKit in an existing logging library looks like I switched Sentry and DiscoLog suites to it: sentry, disco-log

Hex: logger_handler_kit | Hex
Github:

https://github.com/martosaur/logger_handler_kit

First 5 of 5 Posts Switch mode

jberling

jberling

Great! I started to implement a structured logger for dev purposes, but got stuck and decided to park the project. Maybe this could get me started again! Thanks!

martosaur

martosaur OP

LoggerHandlerKit received two new guides: about log translation and unhandled errors

venkatd

venkatd

I just wanted to thank you for sharing this. I was struggling to implement a proper logger (BetterStack in our case). It seems like logging in Elixir has evolved a lot over the years so it’s hard to know what the latest best practices are.

martosaur

martosaur OP

Yay :tada: I’m glad you find it helpful!

martosaur

martosaur OP

LoggerHandlerKit v0.2.0 released and it’s all about metadata: check out this guide and test cases. This is also the release where I shamelessly shill LoggerJSON for its redactor-encoder. :blush:

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement