halostatue

halostatue

Capture_logger - ExUnit.CaptureLog with alternate formatter support

I’ve published CaptureLogger 1.0, a very light modification to ExUnit.CaptureLogger (mostly to ExUnit.CaptureServer) that supports passing a formatter to be used instead of Logger.default_formatter/0. This allows testing log captures with LoggerJSON, for example, which matters particularly for testing LoggerJSON.Redactor implementations or for metadata that is more complex than the default Logger formatter permits.

This is something that could easily be added to ExUnit if the core team is interested (I’m happy to submit a PR) but this library will be useful for older version of Elixir that don’t include such a change.

Most Liked

halostatue

halostatue

The excellent news is that this will be native in a future version of Elixir.

CaptureLogger probably won’t be updated to match the more limited configuration option that is in ExUnit.CaptureLog with this, but a future version might start warning about this when the next version of Elixir is closer to release, so that it will be simpler to convert when upgrading (CaptureLogger will still be useful for all versions before the version of Elixir that contains this).

axelson

axelson

Scenic Core Team

Thank you for this library! I’ve wanted this feature as well :+1:

I look forward to trying it out when I find the time :clinking_glasses:

Where Next?

Popular in Announcing Top

zachdaniel
Hey folks! AshEvents Release We’ve just released the first version of AshEvents, an Event Sourcing tool for Ash Framework apps. Check o...
New
RobinBoers
Renders Jinja templates, either from disk or defined at runtime, with support for all native Jinja features (including extends). It does...
New
rodloboz
I’ve started working on a new library to run SQL queries and do basic business intelligence. Think “Blazer for Elixir.” Currently it fe...
New
halostatue
Enviable is a small collection of functions to make working with environment variables easier when configuring Elixir projects. It is des...
New
zteln
Hello Elixir community, I’ve written a small embedded key-value database in Elixir called Goblin. It’s based on the Log-Structured Merge...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
Asd
Hi, I am happy to release the Repatch library for mocking and patching implementation in tests and anywhere else. It brings new possibili...
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
tmbb
Playfair (named after: William Playfair) is a data visualization/plotting library with the goal of being able to produce publication-qual...
New
byoungdale
Hey everyone, I’m excited to share my first hex package: parrot_platform | Hex - a pure Elixir SIP protocol implementation with RTP audi...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New

We're in Beta

About us Mission Statement