Compare commits

..

No commits in common. "6b3ebebecb38642ea3d54286367b364b0a0d476d" and "0f40da5efad8839db531ab279138cd9b449b28d7" have entirely different histories.

2 changed files with 2 additions and 14 deletions

View File

@ -147,11 +147,6 @@ func setupSlog(conf *conf.Conf) error {
if logPath != "" { if logPath != "" {
slog.Info("debug log", "path", logPath) slog.Info("debug log", "path", logPath)
} }
slog.LogAttrs( slog.LogAttrs(context.TODO(), slog.LevelInfo, "setup slog attrs", attrs...)
context.Background(),
slog.LevelInfo,
"setup slog attrs",
attrs...,
)
return nil return nil
} }

View File

@ -1,7 +1,6 @@
package log package log
import ( import (
"context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"log/slog" "log/slog"
@ -12,7 +11,6 @@ import (
type Conf struct { type Conf struct {
FileName string `default:"stdout"` FileName string `default:"stdout"`
Msg string `default:"log msg"` Msg string `default:"log msg"`
Level int `default:"0"`
} }
type Log struct{} type Log struct{}
@ -32,12 +30,7 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
for key, value := range data { for key, value := range data {
args = append(args, key, value) args = append(args, key, value)
} }
slog.Default().Log( slog.Info(conf.Msg, args...)
context.Background(),
slog.Level(conf.Level),
conf.Msg,
args...,
)
return stage.ParserResult{ return stage.ParserResult{
Score: 0, Score: 0,
Comment: "", Comment: "",