Skip to content

Releases: charmbracelet/log

v0.4.0

21 Mar 15:42
d23bea6
Compare
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

  • bcd4738: feat(deps): bump github.com/charmbracelet/lipgloss from 0.9.1 to 0.10.0 (#112) (@dependabot[bot])
  • 976db2b: feat(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#108) (@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.1

27 Nov 18:55
595fffe
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.

v0.2.1

22 Mar 18:05
6e534d0
Compare
Choose a tag to compare

Changelog

Bug fixes

Dependency updates

  • 8ca9b06: feat(deps): bump github.com/mattn/go-isatty from 0.0.17 to 0.0.18 (@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.0

20 Mar 16:14
Compare
Choose a tag to compare

BREAKING CHANGE

  • Drop functional options.
  • Introduce log.NewWithOptions(io.Writer, log.Options) and log.Options{} to create a new logger with custom options.
  • Add format methods to format the log message just like fmt.Printf().
  • Add log.WithPrefix(string) that returns a new sub-logger with prefix.
  • Parse level from string log.ParseLevel(string)
  • Custom key/value styles.
  • Caller source formatter.
  • And a bunch of bug fixes.

Changelog

New Features

Bug fixes

Dependency updates

  • e6729aa: feat(deps): bump github.com/charmbracelet/lipgloss from 0.7.0 to 0.7.1 (@dependabot[bot])
  • 6630e96: feat(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (@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.1.2

27 Feb 20:12
c158121
Compare
Choose a tag to compare

Changelog

New Features

Bug fixes

Dependency updates

  • 6630e96: feat(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (@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.