remove duplicated JSON

This commit is contained in:
2025-05-09 18:43:02 +02:00
parent 4e2b95f945
commit 5141acaa12
2 changed files with 4 additions and 25 deletions

View File

@ -1,7 +1,9 @@
## dates and their corresponding seconds been here :)
[24-11-15]
u80864958_at_u80864958 = 979
[25-03-11]
schreifuchs_at_archibald = 195
[24-11-18]
u80864958_at_u80864958 = 3139
[25-03-11]
schreifuchs_at_archibald = 195
[25-05-09]
schreifuchs_at_archibald = 10

View File

@ -32,26 +32,3 @@ func JSON(logs <-chan *logger.Log) {
println(string(out))
}
}
// JSON logs to std wit the schema:
// {"time":"","level":"","message":""}.
func JSON(logs <-chan *logger.Log) {
for log := range logs {
timedLog := struct {
Time time.Time `json:"time"`
LVL lvl.Level `json:"level"`
Message string `json:"message"`
}{
Time: time.Now(),
LVL: log.Level,
Message: log.Message,
}
out, err := json.Marshal(timedLog)
if err != nil {
fmt.Println("Error while marshaling log: ", err)
os.Exit(1)
}
println(string(out))
}
}