erlang-lager / lager

A logging framework for Erlang/OTP
Apache License 2.0
1.12k stars 456 forks source link

add a pterm formatter #529

Closed evanmcc closed 4 years ago

evanmcc commented 4 years ago

This PR adds a formatting command {pterm, key, DefaultVal}.

This is meant for adding global things to the formatting string, which can be set once, on startup, rather than repeatedly stuffed into the pid-specific metadata. My particular use case is the OS pid, so it's easier to tell when, in the logs, a particular process restarted.

jadeallenx commented 4 years ago

The only hesitation I have is that persistent_term was introduced in OTP 21.2, so the test should skip if OTP is less than that. But I can fix that up

jadeallenx commented 4 years ago

closing in favor of #530