diff --git a/README.md b/README.md index ae24311..93d896e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ func main(){ } ``` +Check out this [simple example file](cmd/simple/main.go) for the basic usage. + ## Multiple Log Instance Create a new log instance (instead of using the `Default`). diff --git a/cmd/simple/main.go b/cmd/simple/main.go index 2b2b224..ced0b54 100644 --- a/cmd/simple/main.go +++ b/cmd/simple/main.go @@ -1,15 +1,24 @@ package main import ( - "git.martin-riedl.de/golang/log" "runtime" + + "git.martin-riedl.de/golang/log" ) func main() { someMethod() + anotherMethod() } func someMethod() { log.Default.Info("Hello World") - log.Default.With("os", runtime.GOOS).Info("environment detected") + log.Default.With("os", runtime.GOOS).Warning("environment detected") +} + +func anotherMethod() { + log.Default.WithMap(map[string]any{ + "foo": "bar", + "bar": "baz", + }).Info("Second Hello World") }