DEVELOPER TOOLS & OPEN SOURCE

Lilac Zero-Dependency Logging.

Lilac was born out of frustration with existing logging libraries that were bloated with dependencies. The goal was to build a zero-dependency, strongly-typed logger that supports custom transports and structured JSON logging out of the box.

EXECUTIVE SUMMARY

Lilac was born out of frustration with existing logging libraries that were bloated with dependencies. The goal was to build a zero-dependency, strongly-typed logger that supports custom transports and structured JSON logging out of the box.

KEY CONTRIBUTION

"Implemented a lazy-evaluation mechanism for log arguments, ensuring complex object stringification only occurs if the log level is active, saving considerable CPU cycles in production."

SYSTEM ARCHITECTURE

High-level overview of the control and data plane components.

CORE SYSTEM

Lightweight Logger

Zero-dependency TypeScript logging core

Custom Transports

Pluggable sink interface for log routing

OUTPUT SINKS

Console

Standard out/err with rich formatting

File

Local file system logging transport

Remote

Network transports for observability

ENGINEERING STACK

Zero-dependency utility package optimized for NPM.

LANGUAGE

TypeScriptNode.js

BUILD & TOOLING

TSupESLintPrettierJest

CI/CD

GitHub ActionsNPM Registry

TECHNICAL DECISIONS

Documenting the trade-offs and architectural shifts during development.

Dependency Management

Third-party formatters
Zero-dependency core
Rationale: Supply chain security is paramount for a logging library that runs in every service. By writing our own lightweight JSON stringifier and formatters, we eliminated risk of malicious downstream updates and kept the bundle size under 4KB.

MEASURABLE IMPACT

Metrics tracking package efficiency and adoption.

UNPACKED SIZE
114 kB
⚡ Supports Kafka, Push, etc.
DEBUGGING TIME
20 %
⚡ Reduced via strict typings

POSTMORTEM & LEARNINGS

Learnings from maintaining open-source tooling.

The strict TypeScript generic bindings for log metadata allowed developers to catch schema errors at compile-time rather than runtime, which became the most praised feature of the library.

Adding native OpenTelemetry integration as a default transport to automatically trace logs across microservice boundaries without additional configuration.