No description
Find a file
Daniel Baumann d2363e6232
Releasing fastforward version 0.3.1-3~ffwd13+u1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2026-03-09 06:40:06 +01:00
.github Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
debian Releasing fastforward version 0.3.1-3~ffwd13+u1. 2026-03-09 06:40:06 +01:00
.gitattributes Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
.gitignore Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
go.mod Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
levels.go Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
levels_test.go Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
LICENSE Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
logr.go Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
logr_test.go Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00
README.md Adding upstream version 0.3.1. 2025-09-22 16:04:08 +02:00

logr

Go logging library with levels.

Usage

go get -u github.com/TwiN/logr
import "github.com/TwiN/logr"

func main() {
    logr.Debug("This is a debug message")
    logr.Infof("This is an %s message", "info")
    logr.Warn("This is a warn message")
    logr.Error("This is an error message")
    logr.Fatal("This is a fatal message") // Exits with code 1
}

You can set the default logger's threshold like so:

logr.SetThreshold(logr.LevelWarn)

The above would make it so only WARN, ERROR and FATAL messages are logged, while DEBUG and INFO messages are ignored.

TODO: Finish documentation