adjust log levels for cron things
parent
f4016da220
commit
052bb05331
|
|
@ -3,6 +3,7 @@ package config
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"local/args"
|
"local/args"
|
||||||
|
"local/logb"
|
||||||
"local/storage"
|
"local/storage"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -38,10 +39,13 @@ func Refresh() {
|
||||||
as.Append(args.STRING, "storepass", "storage password", "")
|
as.Append(args.STRING, "storepass", "storage password", "")
|
||||||
as.Append(args.STRING, "root", "root for static files", "./public")
|
as.Append(args.STRING, "root", "root for static files", "./public")
|
||||||
as.Append(args.STRING, "config", "cron config to load;; non-persisting", "")
|
as.Append(args.STRING, "config", "cron config to load;; non-persisting", "")
|
||||||
|
as.Append(args.STRING, "level", "log level", "info")
|
||||||
if err := as.Parse(); err != nil {
|
if err := as.Parse(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logb.Set(logb.LevelFromString(as.Get("level").GetString()))
|
||||||
|
|
||||||
Port = ":" + strings.TrimPrefix(as.Get("port").GetString(), ":")
|
Port = ":" + strings.TrimPrefix(as.Get("port").GetString(), ":")
|
||||||
OAuthServer = as.Get("oauth").GetString()
|
OAuthServer = as.Get("oauth").GetString()
|
||||||
StoreType = as.Get("storetype").GetString()
|
StoreType = as.Get("storetype").GetString()
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,14 @@ func New() Logger {
|
||||||
|
|
||||||
func (l Logger) Info(m string, args ...interface{}) {
|
func (l Logger) Info(m string, args ...interface{}) {
|
||||||
args = append([]interface{}{m}, args...)
|
args = append([]interface{}{m}, args...)
|
||||||
logb.Info(args...)
|
switch m {
|
||||||
|
case "wake":
|
||||||
|
logb.Verbose(args...)
|
||||||
|
case "run":
|
||||||
|
logb.Debug(args...)
|
||||||
|
default:
|
||||||
|
logb.Info(args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l Logger) Error(e error, m string, args ...interface{}) {
|
func (l Logger) Error(e error, m string, args ...interface{}) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue