diff --git a/handlers/dashboard.go b/handlers/dashboard.go index 797fa9d2..b69a9d79 100644 --- a/handlers/dashboard.go +++ b/handlers/dashboard.go @@ -89,9 +89,7 @@ func LogsLineHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) return } - - w.Write([]byte(utils.LastLine)) - + w.Write([]byte(utils.LastLine.(string))) } type backups struct { diff --git a/utils/log.go b/utils/log.go index 8795a5cf..9d0003ee 100644 --- a/utils/log.go +++ b/utils/log.go @@ -16,7 +16,7 @@ var ( logLevel int fmtLogs *log.Logger ljLogger *lumberjack.Logger - LastLine string + LastLine interface{} ) func InitLogs() { @@ -67,7 +67,7 @@ func Panic(err interface{}) { } func Log(level int, err interface{}) { - LastLine = err.(string) + LastLine = err switch level { case 5: fmt.Printf("PANIC: %v\n", err)