mirror of
https://codeberg.org/scip/yadu.git
synced 2025-12-16 20:21:00 +01:00
fix example
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
coverage.out
|
coverage.out
|
||||||
|
example/example
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/tlinden/yadu"
|
||||||
)
|
)
|
||||||
|
|
||||||
type body string
|
type body string
|
||||||
@@ -30,12 +32,12 @@ func removeTime(_ []string, a slog.Attr) slog.Attr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
opts := &YamlDumpHandlerOptions{
|
opts := &yadu.Options{
|
||||||
Level: slog.LevelDebug,
|
Level: slog.LevelDebug,
|
||||||
//ReplaceAttr: removeTime,
|
//ReplaceAttr: removeTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
logger := slog.New(NewYamlDumpHandler(os.Stdout, opts))
|
logger := slog.New(yadu.NewHandler(os.Stdout, opts))
|
||||||
|
|
||||||
slog.SetDefault(logger)
|
slog.SetDefault(logger)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user