From 03df87ee9464f6d7a1ca50254dcc5b81d1cf2625 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Sep 2021 14:41:25 +0300 Subject: add spartan mode --- internal/config/read.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/config/read.go') diff --git a/internal/config/read.go b/internal/config/read.go index a4e605b..ea358f8 100644 --- a/internal/config/read.go +++ b/internal/config/read.go @@ -5,7 +5,7 @@ import ( ) // Read the DTail configuration. -func Read(configFile string, sshPort int) { +func Read(configFile string, sshPort int, noColor bool) { initializer := configInitializer{ Common: newDefaultCommonConfig(), Server: newDefaultServerConfig(), @@ -34,4 +34,7 @@ func Read(configFile string, sshPort int) { if sshPort != 2222 { Common.SSHPort = sshPort } + if noColor { + Client.TermColorsEnable = false + } } -- cgit v1.2.3 From 3223be4cf95d0b6828196ac7a84277c18f3f5655 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 19 Sep 2021 13:22:59 +0300 Subject: move args to config package logger package rewrite as dlog --- internal/config/read.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 internal/config/read.go (limited to 'internal/config/read.go') diff --git a/internal/config/read.go b/internal/config/read.go deleted file mode 100644 index ea358f8..0000000 --- a/internal/config/read.go +++ /dev/null @@ -1,40 +0,0 @@ -package config - -import ( - "os" -) - -// Read the DTail configuration. -func Read(configFile string, sshPort int, noColor bool) { - initializer := configInitializer{ - Common: newDefaultCommonConfig(), - Server: newDefaultServerConfig(), - Client: newDefaultClientConfig(), - } - - if configFile == "" { - configFile = "./cfg/dtail.json" - } - - if _, err := os.Stat(configFile); !os.IsNotExist(err) { - initializer.parseConfig(configFile) - } - - // Assign pointers to global variables, so that we can access the - // configuration from any place of the program. - Common = initializer.Common - Server = initializer.Server - Client = initializer.Client - - if Server.MapreduceLogFormat == "" { - Server.MapreduceLogFormat = "default" - } - - // If non-standard port specified, overwrite config - if sshPort != 2222 { - Common.SSHPort = sshPort - } - if noColor { - Client.TermColorsEnable = false - } -} -- cgit v1.2.3