DEV.co
Open-Source Observability · charmbracelet

log

Charm Log is a lightweight, colorful Go logging library emphasizing human-readable output with structured key-value logging. It supports multiple formatters (text, JSON, logfmt), customizable styling via Lip Gloss, and integrates with Go's slog handler for compatibility with the standard library.

Source: GitHub — github.com/charmbracelet/log
3.3k
GitHub stars
99
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorycharmbracelet/log
Ownercharmbracelet
Primary languageGo
LicenseMIT — OSI-approved
Stars3.3k
Forks99
Open issues40
Latest releasev2.0.0 (2026-03-09)
Last updated2026-07-06
Sourcehttps://github.com/charmbracelet/log

What log is

A minimal Go logging package providing leveled logging (Debug, Info, Warn, Error, Fatal), structured key-value pairs, multiple output formatters, context storage/retrieval, and caller reporting. Built on Lip Gloss for terminal styling; disables styling automatically when output is not a TTY.

Quickstart

Get the log source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/charmbracelet/log.gitcd log# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

CLI and Terminal Applications

Ideal for command-line tools and scripts where human-readable, colorful output directly in the terminal is primary. The styling and minimal overhead fit well with interactive CLI workflows.

Development and Debugging

Excellent for local development environments where rich, formatted logs aid quick troubleshooting. Custom styles and prefixes make it easy to identify log sources across components.

Small to Medium Go Services

Suitable for microservices or internal APIs where you need structured logging without the complexity of enterprise log aggregation; supports slog handler for integration with standard library.

Implementation considerations

  • Default log level is 'info'; set level explicitly (DebugLevel, etc.) to avoid missed debug logs in development.
  • Styling via Lip Gloss disables automatically when output is not a TTY; verify behavior in containerized/CI environments.
  • Use With() to chain structured fields and reduce noise; consider global logger vs. instance loggers for multi-component setups.
  • Set ReportCaller and ReportTimestamp based on output format; JSON output should include timestamps for indexing.
  • Go 1.21+ recommended if using slog handler integration; verify compatibility with your target Go version.

When to avoid it — and what to weigh

  • High-Volume Production Logging at Scale — No evidence of batching, async I/O optimization, or performance tuning for millions of log events. May not be suitable for systems requiring high-throughput, low-latency logging.
  • Centralized Log Aggregation Requirement — Limited integration examples with ELK, Splunk, or cloud logging services. While JSON/logfmt formatters exist, no mention of built-in exporters or instrumentation hooks for aggregation systems.
  • Mission-Critical Security Audit Logging — No mention of tamper-proof logging, encryption, or compliance certifications (e.g., SOC2, HIPAA). Unsuitable where regulatory or forensic log integrity is mandatory.
  • Windows/Non-TTY Environments Without Careful Testing — TTY detection disables styling automatically, but cross-platform consistency across Windows terminals and remote SSH sessions is not explicitly documented.

License & commercial use

MIT License (permissive OSI-approved license). Permits commercial use, modification, and distribution with attribution. No copyleft obligations.

MIT License clearly permits commercial use. No subscription, proprietary restrictions, or licensing barriers. Safe for product development. Maintain attribution as per license terms.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No security-specific features documented. Handles structured key-value data as-is; ensure sensitive data (passwords, tokens, PII) is not logged. TTY detection relies on file descriptor inspection; verify in restricted environments. No input validation or sanitization guarantees stated.

Alternatives to consider

go-kit/log

Production-grade structured logging with stronger performance profile and ecosystem integration; more verbose API; better for large-scale services.

zap (Uber)

High-performance, zero-allocation logging; steeper learning curve; industrial-strength for services at scale; less human-friendly defaults.

slog (stdlib)

Built-in as of Go 1.21; minimal dependencies; less styling/customization; preferred if lock-in to stdlib and standard ecosystem matters.

Software development agency

Build on log with DEV.co software developers

Evaluate Charm Log for your CLI tools, services, and development workflows. Lightweight, MIT-licensed, and actively maintained by charmbracelet.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

log FAQ

Can I use Charm Log in production?
Yes, under MIT license. However, evaluate performance, log aggregation integration, and audit logging needs first. Better suited for small/medium services or CLI tooling than high-throughput systems.
How does Charm Log handle structured logging?
Via key-value pairs passed as variadic arguments to log functions (e.g., log.Error(msg, key1, val1, key2, val2)). Supports multiple formatters (text, JSON, logfmt) for different output targets.
What is the performance impact?
Unknown. No benchmarks provided. For I/O-bound operations, always benchmark in your target environment. Styling has overhead; disable for high-volume logging by using non-TTY or JSONFormatter.
How do I integrate with centralized logging (e.g., ELK, Datadog)?
Use JSONFormatter or LogfmtFormatter and pipe output to your aggregator's collector. No built-in exporter; manual setup required. Ensure timestamps and structured fields align with your indexing schema.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like log into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source observability stack.

Ready to improve your Go logging?

Evaluate Charm Log for your CLI tools, services, and development workflows. Lightweight, MIT-licensed, and actively maintained by charmbracelet.