Skip to content

Releases: charmbracelet/log

v2.0.0

09 Mar 12:40
v2.0.0
32debe4

Choose a tag to compare

What's New in Log v2

We're excited to announce the second major release of Log!

Note

If you're looking for technical details on migrating from v1, check out the Upgrade Guide.

❤️ Charm Land Import Path

We've updated our import paths to use vanity domains and our own domain to import Go packages.

// Before
import "github.com/charmbracelet/log"

// After
import "charm.land/log/v2"

🎨 Lip Gloss v2

Log v2 now uses Lip Gloss v2, which brings a pure, streamlined styling experience. No more fighting over i/o! Lip Gloss is now pure, which means Log manages i/o and styling flows smoothly without conflicts.

What does this mean for you? Built-in color downsampling. Your logs will look great in any terminal, automatically downsampling colors to match the terminal's capabilities. No more broken colors in limited color environments.

🌈 Modern Color Profile Support

Log v2 uses the colorprofile library to automatically detect and adapt to your terminal's color capabilities. Your logs will "just work" across all terminals, from basic 16-color setups to true color displays.

Colors are automatically downsampled to the best available profile, so your styled logs never misbehave—whether you're in a fancy modern terminal or a basic SSH session.

🔧 Simpler API

We've cleaned up the API to make working with color profiles more intuitive:

// Set a color profile manually
logger.SetColorProfile(colorprofile.TrueColor)

// The logger automatically handles downsampling

The SetColorProfile method now uses colorprofile.Profile instead of termenv.Profile, giving you direct control over color handling with a modern, well-supported library.

✨ Updated Styles with Lip Gloss v2

All style fields in the Styles struct now use Lip Gloss v2. The styling API remains familiar, but benefits from improved performance and the new pure architecture:

styles := log.DefaultStyles()
styles.Levels[log.ErrorLevel] = lipgloss.NewStyle().
    SetString("ERROR!!").
    Padding(0, 1, 0, 1).
    Background(lipgloss.Color("204")).
    Foreground(lipgloss.Color("0"))

Lip Gloss v2 brings better rendering, improved performance, and a cleaner separation of concerns between styling and i/o.

🚀 Better Performance

With the move to Lip Gloss v2 and colorprofile, Log v2 delivers:

  • Faster rendering — Pure Lip Gloss means less overhead
  • Smarter color handling — Automatic downsampling reduces unnecessary processing
  • Cleaner output — Colors that work correctly in every environment

📦 Smaller Dependency Tree

Log v2 has a streamlined set of dependencies:

  • charm.land/lipgloss/v2 — Pure styling, no i/o conflicts
  • github.com/charmbracelet/colorprofile — Smart color detection and downsampling
  • Removed termenv dependency — Everything handled through modern libraries

🔮 Ready for the Future

The v2 architecture sets Log up for future enhancements. The pure Lip Gloss foundation and modern color handling mean we can add new features without architectural constraints.

🌍 What Stays the Same

All the features you love about Log are still here:

  • ✅ Leveled logging (Debug, Info, Warn, Error, Fatal)
  • ✅ Structured key-value pairs
  • ✅ Customizable styles and colors
  • ✅ Multiple formatters (Text, JSON, Logfmt)
  • ✅ Sub-loggers with context
  • ✅ Slog handler support
  • ✅ Standard log adapter
  • ✅ Helper functions
  • ✅ Timestamp and caller reporting

The core API remains familiar—you're just getting better performance and color handling under the hood.

🌈 More on Log v2

Ready to upgrade? Head over to the Upgrade Guide for the complete migration checklist.


Changelog

New!

Fixed

Docs

Other stuff


Feedback

Have thoughts on Log v2? We'd love to hear about it. Let us know on…


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة

v0.4.2

12 May 14:47
v0.4.2
4dcdb75

Choose a tag to compare

This release fixes an issue when using the JSON logger as a slog handler logging error type messages. It ensures we extract the error from the message when the error does not implement json.Marshaler.

Changelog

Bug fixes

Other work


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.4.1

12 Mar 18:52
v0.4.1
62ddc70

Choose a tag to compare

This release includes bug fixes for custom slog levels, data race with the default logger and deep copying fields, JSON handling improvements, and supporting slog attributes.

Changelog

New Features

Bug fixes

Dependency updates

Documentation updates

Other work


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.4.0

21 Mar 15:42
d23bea6

Choose a tag to compare

Custom Levels

With this release of Log, you can now style your custom level to your liking!

// Define a new level
const SuccessLevel = log.InfoLevel + 1

// Create a style
styles := log.DefaultStyles()
styles.Levels[SuccessLevel] = lipgloss.NewStyle().
    SetString("SUCCESS").
    Bold(true).
    Foreground(lipgloss.Color("42"))

// Set the styles on the default logger
log.SetStyles(styles)

// Define your custom func
func Success(msg string, args ...any) {
	log.Default().Log(SuccessLevel, msg, args...)
}

Along with that, this release includes some important bug fixes detailed below.

Changelog

New Features

Bug fixes

Dependency updates

Documentation updates

Other work


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.3.1

27 Nov 18:55
595fffe

Choose a tag to compare

Changelog

New Features

Bug fixes

Dependency updates

  • e5a733b: feat(deps): bump github.com/charmbracelet/lipgloss from 0.8.0 to 0.9.1 (#76) (@dependabot[bot])

Documentation updates

Other work


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.3.0

07 Nov 14:15
1231b7b

Choose a tag to compare

This new release of Log adds support for log/slog, and per-instance styles, and includes bug fixes. You can now use Log as a log/slog handler in your applications. Log comes with its own JSON and Logfmt formatters, on the other hand, Slog uses different handlers for these formats.

Breaking Changes!

  • Bump the minimum GoLang version to 1.19
  • Change the default timestamp key from ts to time to match log/slog
  • Change the default level key from lvl to level to match log/slog
  • ParseLevel() now returns an error if parse failed to find a level in string
  • Default levels values changed to be increments of 4 i.e. DebugLevel = -4, InfoLevel = 0, WarnLevel = 4, ...
  • Global styles are replaced with DefaultStyles() and SetStyles()

Changelog

New Features

Bug fixes

Dependency updates

  • e5a733b: feat(deps): bump github.com/charmbracelet/lipgloss from 0.8.0 to 0.9.1 (#76) (@dependabot[bot])

Other work


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.2.5

04 Oct 20:11
6c11a72

Choose a tag to compare

Changelog

New Features

Bug fixes


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.2.4

22 Aug 19:54
6699e64

Choose a tag to compare

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

Full Changelog: v0.2.3...v0.2.4

v0.2.3

01 Aug 18:59
97dd8c9

Choose a tag to compare

Changelog

New Features

Bug fixes

Dependency updates

  • 31d2a53: feat(deps): bump github.com/muesli/termenv from 0.15.1 to 0.15.2 (@dependabot[bot])
  • c39b96e: feat(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (@dependabot[bot])

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.2.2

23 May 14:45

Choose a tag to compare

Changelog

New Features

Bug fixes

Dependency updates

  • 347b8ef: feat(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (@dependabot[bot])

Documentation updates


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.