diff --git a/backend/cmd/root.go b/backend/cmd/root.go index 8c6c322f..9d0ef3eb 100644 --- a/backend/cmd/root.go +++ b/backend/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/apex/log" "strings" "github.com/spf13/cobra" @@ -54,4 +55,17 @@ func initConfig() { if err := viper.ReadInConfig(); err == nil { fmt.Println("Using config file:", viper.ConfigFileUsed()) } + + // initialize log level + initLogLevel() +} + +func initLogLevel() { + // set log level + logLevel := viper.GetString("log.level") + l, err := log.ParseLevel(logLevel) + if err != nil { + l = log.InfoLevel + } + log.SetLevel(l) } diff --git a/backend/go.mod b/backend/go.mod index ef8367fc..63f78ded 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/apex/log v1.9.0 - github.com/crawlab-team/crawlab-core v0.6.0-beta.20211219.2134 + github.com/crawlab-team/crawlab-core v0.6.0-beta.20211224.1500 github.com/crawlab-team/go-trace v0.1.1 github.com/gin-gonic/gin v1.7.1 github.com/spf13/cobra v1.1.3 diff --git a/backend/go.mod.local b/backend/go.mod.local index 129fe194..41c13932 100644 --- a/backend/go.mod.local +++ b/backend/go.mod.local @@ -11,11 +11,10 @@ replace ( require ( github.com/apex/log v1.9.0 - github.com/crawlab-team/crawlab-core v0.6.0-beta.20211213.2006 - github.com/crawlab-team/go-trace v0.1.0 + github.com/crawlab-team/crawlab-core v0.6.0-beta.20211219.2134 + github.com/crawlab-team/go-trace v0.1.1 github.com/gin-gonic/gin v1.7.1 github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.7.1 - go.mongodb.org/mongo-driver v1.6.0 // indirect go.uber.org/dig v1.10.0 ) diff --git a/backend/test/config-worker-03.json b/backend/test/config-worker-03.json new file mode 100644 index 00000000..70da53f1 --- /dev/null +++ b/backend/test/config-worker-03.json @@ -0,0 +1,10 @@ +{ + "key": "worker-03", + "is_master": false, + "name": "Worker Node 03", + "ip": "", + "mac": "", + "hostname": "", + "description": "", + "auth_key": "Crawlab2021!" +} \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index a41ba197..1f460a36 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "@crawlab/app", - "version": "0.6.0-beta.20211221.1200", + "version": "0.6.0-beta.20211224.1500", "description": "", "scripts": { "serve": "vue-cli-service serve", @@ -15,7 +15,7 @@ }, "license": "BSD-3-Clause", "dependencies": { - "crawlab-ui": "0.6.0-beta.20211219.1200", + "crawlab-ui": "0.6.0-beta.20211224.1500", "vue": "3.0.11", "vue-router": "^4.0.11" }, diff --git a/frontend/public/index.html b/frontend/public/index.html index e307c2bc..113fdc38 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,12 +1,12 @@
+