Skip to content

v0.4.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 21 Mar 15:42
· 19 commits to main since this release
d23bea6

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.