Skip to content
CAI
Software that uses CAICheck a score

erlang-lager/lager

62.9

Adequate · 23 September 2026

8.4k

lines of production code

Erlang

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a structured logging library for Erlang applications, designed to replace or augment the standard error\_logger. It provides a macro-based API for attaching structured metadata to log messages and supports runtime configuration, message throttling, and log rotation. The codebase includes comprehensive test coverage for features like record compression, crash handling, and log formatting.

Features

Added CSS styling for edoc documentation pages

A new stylesheet (priv/edoc.css) has been added to style the generated EDoc documentation. This introduces a consistent visual theme for the documentation, including typography, spacing, and color accents (e.g., orange highlights for headers and function titles), improving the readability and appearance of the generated HTML pages.

priv · medium confidence

Introduce error\_logger redirection and runtime configuration infrastructure

Adds the \error\_logger\_lager\_h\ module to intercept and redirect Erlang's \error\_logger\ events into the Lager logging system, allowing users to seamlessly migrate from the legacy error logger. The commit also introduces \lager\_config\ for managing runtime configuration, \lager\_backend\_throttle\ for mailbox-based message throttling, and a \lager\_common\_test\_backend\ to facilitate testing by capturing log output. These changes enable more robust error handling, configurable high-water mark shaper, and improved testability for applications using Lager.

src · high confidence

Behavioural changes

Lager logging macros now include structured metadata and support unsafe logging

The \lager.hrl\ header file was added, introducing a new macro-based logging API that automatically attaches structured metadata (such as process ID, node, module, function, and line number) to all log messages. This change separates formatting from backend delivery and introduces \\_unsafe\ variants of the logging macros (e.g., \lager\_info\_unsafe\) that bypass message truncation limits, allowing users to log large messages without size restrictions. Additionally, the header defines bitmasks for log levels and a shaper record to manage message flow control.

include · medium confidence

Refactor build system and update documentation

The project's build system has been refactored by introducing a shared \tools.mk\ Makefile and updating the \Makefile\ to use it, while also adding a \rebar.config.script\ to handle Rebar 2/3 compatibility and dependency pinning. Documentation has been migrated from Org-mode (\README.org\) to Markdown (\README.md\), and a \.gitignore\ file has been added to exclude build artifacts and local configuration files.

(repo-wide) · high confidence

Test coverage

Added tests for record compression, crash handling, metadata whitelisting, and log rotation

Added a suite of EUnit tests to the test/ directory, including compress\_pr\_record\_test.erl for verifying record compression, crash.erl/crash\_fsm.erl/crash\_statem.erl for simulating various process and state machine failures, lager\_metadata\_whitelist\_test.erl for validating metadata filtering, and lager\_rotate.erl for testing log file rotation. Additionally, new test modules were introduced for the manager killer (lager\_manager\_killer\_test.erl), function transforms (lager\_test\_function\_transform.erl), tracing (lager\_trace\_test.erl), stacktrace formatting (pr\_stacktrace\_test.erl), and QuickCheck validation of the truncator (trunc\_io\_eqc.erl).

test · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 58 → 63 (+5.2)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 81 → 88 (+7.2)
  • Architecture 100 → 100 (+0.0)
  • Maturity 34 → 46 (+12.3)
  • Readiness 74 → 64 (-9.7)
  • Security 75 → 85 (+10.2)
  • Event Sourcing 100 → 100 (+0.0)

Resolved (11)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • Test reliability not included
  • TooManyMethods: lager (src/lager.erl)
  • TooManyMethods: lager_util (src/lager_util.erl)
  • complexity unreadable for .erl, .hrl — churn × complexity hotspots could not be measured
  • dormant codebase — no living knowledge left to concentrate

New (40)

  • Coverage not measured — no coverage collector is wired up
  • Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (5 lines × 2) (src/error_logger_lager_h.erl)
  • Duplicated block (5 lines × 2) (src/lager_trunc_io.erl)
  • Duplicated block (8 lines × 3) (src/lager_trunc_io.erl)
  • Duplicated block (8–9 lines × 2) (src/lager_default_formatter.erl)
  • Duplicated block (9 lines × 2) (src/lager_trunc_io.erl)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium: security finding (details withheld)
  • No dependency lockfile committed (rebar.config)
  • Rotate the exposed credentials — git history can't be un-committed
  • Secret: generic-api-key (.travis.yml)
  • TodoComment (src/error_logger_lager_h.erl)
  • TodoComment (src/error_logger_lager_h.erl)
  • TodoComment (src/lager.erl)
  • …and 20 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

erlang-lager/lager was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e6b31784e65b838a10d0a533f4b838da8029e402 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.