to internal logger for levels, all encompassing path

This commit is contained in:
bel
2022-01-17 18:16:23 -07:00
parent e660f2ef9f
commit 73ccc22fd5
9 changed files with 179 additions and 55 deletions

View File

@@ -4,12 +4,17 @@ import (
"encoding/json"
"io/ioutil"
"local/storage"
"local/truckstop/logtr"
"os"
"sync"
"time"
)
type Config struct {
Log struct {
Path string
Level logtr.Level
}
Interval struct {
Input Duration
OK Duration
@@ -121,6 +126,8 @@ func Refresh() error {
if err := json.Unmarshal(b, &c); err != nil {
return err
}
logtr.SetLogpath(c.Log.Path)
logtr.SetLevel(c.Log.Level)
if live.db != nil {
live.db.Close()
}