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.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | charmbracelet/log |
| Owner | charmbracelet |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 3.3k |
| Forks | 99 |
| Open issues | 40 |
| Latest release | v2.0.0 (2026-03-09) |
| Last updated | 2026-07-06 |
| Source | https://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.
Get the log source
Clone the repository and explore it locally.
git clone https://github.com/charmbracelet/log.gitcd log# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
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.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
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.
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.coRelated 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?
How does Charm Log handle structured logging?
What is the performance impact?
How do I integrate with centralized logging (e.g., ELK, Datadog)?
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.