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

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.