LoggerHandlerKit - your guide to Elixir logger handlers

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:

11 Likes

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!

1 Like