1
0
Fork 0

Adding upstream version 0.3.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-17 05:58:17 +02:00
parent 4da56737a9
commit 93a9a63b70
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
11 changed files with 438 additions and 0 deletions

27
README.md Normal file
View file

@ -0,0 +1,27 @@
# logr
Go logging library with levels.
## Usage
```console
go get -u github.com/TwiN/logr
```
```go
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:
```go
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