浏览代码

Optimized log output for highest abstraction layer

Toby Chui 3 年之前
父节点
当前提交
e9e6976874
共有 3 个文件被更改,包括 6 次插入5 次删除
  1. 2 1
      startup.go
  2. 1 1
      storage.bridge.go
  3. 3 3
      system.info.go

+ 2 - 1
startup.go

@@ -7,6 +7,7 @@ package main
 
 import (
 	"fmt"
+	"log"
 	"os"
 
 	db "imuslab.com/arozos/mod/database"
@@ -21,7 +22,7 @@ func RunStartup() {
 
 	//Check if system or web both not exists and web.tar.gz exists. Unzip it for the user
 	if (!fs.FileExists("system/") || !fs.FileExists("web/")) && fs.FileExists("./web.tar.gz") {
-		systemWideLogger.PrintAndLog("Update", "Unzipping system critical files from archive", nil)
+		log.Println("[Update] Unzipping system critical files from archive", nil)
 		extErr := filesystem.ExtractTarGzipFile("./web.tar.gz", "./")
 		if extErr != nil {
 			//Extract failed

+ 1 - 1
storage.bridge.go

@@ -15,7 +15,7 @@ import (
 func BridgeStoragePoolInit() {
 	bridgeRecords, err := bridgeManager.ReadConfig()
 	if err != nil {
-		systemWideLogger.PrintAndLog("Storage", "[ERROR] Fail to read File System Handler bridge config", err)
+		systemWideLogger.PrintAndLog("Storage", "Fail to read File System Handler bridge config", err)
 		return
 	}
 

+ 3 - 3
system.info.go

@@ -15,8 +15,8 @@ import (
 
 //InitShowSysInformation xxx
 func SystemInfoInit() {
-	systemWideLogger.PrintAndLog("Main", "Operation System: "+runtime.GOOS, nil)
-	systemWideLogger.PrintAndLog("Main", "System Architecture: "+runtime.GOARCH, nil)
+	systemWideLogger.PrintAndLog("System", "Operation System: "+runtime.GOOS, nil)
+	systemWideLogger.PrintAndLog("System", "System Architecture: "+runtime.GOARCH, nil)
 
 	//Updates 5 Dec 2020, Added permission router
 	router := prout.NewModuleRouter(prout.RouterOption{
@@ -139,7 +139,7 @@ func SystemInfoInit() {
 				execute, _ := common.Mv(r, "exec", true)
 				if execute == "true" && r.Method == http.MethodPost {
 					//Do the update
-					systemWideLogger.PrintAndLog("Main", "REQUESTING LAUNCHER FOR UPDATE RESTART", nil)
+					systemWideLogger.PrintAndLog("System", "REQUESTING LAUNCHER FOR UPDATE RESTART", nil)
 					executeShutdownSequence()
 					common.SendOK(w)
 				} else if execute == "true" {