From f46abf36e80a67d13d12dbe4ba8c899026e53961 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 31 Jul 2021 18:20:03 +0300 Subject: more on configurable colors --- cmd/dcat/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 238f97a..1aa7798 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -6,7 +6,6 @@ import ( "os" "github.com/mimecast/dtail/internal/clients" - "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/logger" "github.com/mimecast/dtail/internal/io/signal" @@ -42,7 +41,9 @@ func main() { flag.Parse() config.Read(cfgFile, sshPort) - color.Colored = !noColor + if noColor { + config.Client.TermColorsEnabled = false + } if displayVersion { version.PrintAndExit() -- cgit v1.2.3 From 3cc8887885f24a3f0d607af24197bc364ab16b8d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Aug 2021 10:56:36 +0300 Subject: add missing brush and also add color client configs plus jsonschema --- cmd/dcat/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 1aa7798..1732c26 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -42,12 +42,13 @@ func main() { config.Read(cfgFile, sshPort) if noColor { - config.Client.TermColorsEnabled = false + config.Client.TermColorsEnable = false } if displayVersion { version.PrintAndExit() } + version.Print() ctx := context.TODO() logger.Start(ctx, logger.Modes{ -- cgit v1.2.3 From 7fbea88cf55af9b3354b4a1334e49c38d0d920fc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Sep 2021 13:16:36 +0300 Subject: additional flags can be interpreted as file list --- cmd/dcat/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 1732c26..2ac773a 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -4,6 +4,7 @@ import ( "context" "flag" "os" + "strings" "github.com/mimecast/dtail/internal/clients" "github.com/mimecast/dtail/internal/config" @@ -40,6 +41,15 @@ func main() { flag.Parse() + if args.What == "" { + // Interpret additional args as file list. + var files []string + for _, file := range flag.Args() { + files = append(files, file) + } + args.What = strings.Join(files, ",") + } + config.Read(cfgFile, sshPort) if noColor { config.Client.TermColorsEnable = false -- cgit v1.2.3 From 6506e20f6c80f4acb7434eb9dd14f784a67189cd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Sep 2021 14:41:25 +0300 Subject: add spartan mode --- cmd/dcat/main.go | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 2ac773a..63b4b61 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -4,7 +4,6 @@ import ( "context" "flag" "os" - "strings" "github.com/mimecast/dtail/internal/clients" "github.com/mimecast/dtail/internal/config" @@ -20,16 +19,16 @@ func main() { var cfgFile string var debugEnable bool var displayVersion bool - var noColor bool var sshPort int userName := user.Name() + flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") + flag.BoolVar(&args.Spartan, "spartan", false, "Spartan output mode") flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") - flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") + flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") flag.IntVar(&args.ConnectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") flag.IntVar(&sshPort, "port", 2222, "SSH server port") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") @@ -40,25 +39,16 @@ func main() { flag.StringVar(&cfgFile, "cfg", "", "Config file path") flag.Parse() - - if args.What == "" { - // Interpret additional args as file list. - var files []string - for _, file := range flag.Args() { - files = append(files, file) - } - args.What = strings.Join(files, ",") - } - - config.Read(cfgFile, sshPort) - if noColor { - config.Client.TermColorsEnable = false - } + args.Transform(flag.Args()) + config.Read(cfgFile, sshPort, args.NoColor) + args.TransformAfterConfigFile() if displayVersion { version.PrintAndExit() } - version.Print() + if !args.Spartan { + version.Print() + } ctx := context.TODO() logger.Start(ctx, logger.Modes{ -- cgit v1.2.3 From fe3e68afd99d8ea246be52893730f987e138ec24 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 --- cmd/dcat/main.go | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 63b4b61..d5dfba4 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -4,10 +4,11 @@ import ( "context" "flag" "os" + "sync" "github.com/mimecast/dtail/internal/clients" "github.com/mimecast/dtail/internal/config" - "github.com/mimecast/dtail/internal/io/logger" + "github.com/mimecast/dtail/internal/io/dlog" "github.com/mimecast/dtail/internal/io/signal" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" @@ -15,33 +16,28 @@ import ( // The evil begins here. func main() { - var args clients.Args - var cfgFile string - var debugEnable bool + var args config.Args var displayVersion bool - var sshPort int userName := user.Name() + flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") flag.BoolVar(&args.Quiet, "quiet", false, "Quiet output mode") flag.BoolVar(&args.Spartan, "spartan", false, "Spartan output mode") - flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") - flag.BoolVar(&debugEnable, "debug", false, "Activate debug messages") + flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Trust all unknown host keys") flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.BoolVar(&args.NoColor, "noColor", false, "Disable ANSII terminal colors") flag.IntVar(&args.ConnectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") - flag.IntVar(&sshPort, "port", 2222, "SSH server port") + flag.IntVar(&args.SSHPort, "port", 2222, "SSH server port") + flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") + flag.StringVar(&args.LogLevel, "logLevel", "", "Log level") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") - flag.StringVar(&cfgFile, "cfg", "", "Config file path") flag.Parse() - args.Transform(flag.Args()) - config.Read(cfgFile, sshPort, args.NoColor) - args.TransformAfterConfigFile() + config.Setup(&args, flag.Args()) if displayVersion { version.PrintAndExit() @@ -50,11 +46,10 @@ func main() { version.Print() } - ctx := context.TODO() - logger.Start(ctx, logger.Modes{ - Debug: debugEnable || config.Common.DebugEnable, - Quiet: args.Quiet, - }) + ctx, cancel := context.WithCancel(context.Background()) + var wg sync.WaitGroup + wg.Add(1) + dlog.Start(ctx, &wg, dlog.CLIENT, config.Common.LogLevel) client, err := clients.NewCatClient(args) if err != nil { @@ -62,6 +57,8 @@ func main() { } status := client.Start(ctx, signal.InterruptCh(ctx)) - logger.Flush() + cancel() + + wg.Wait() os.Exit(status) } -- cgit v1.2.3 From fcaa94c7453efa0d74e330128c0f5c2cde8f11b3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 26 Sep 2021 16:42:47 +0300 Subject: refactor config reader - also looks in additional search paths for config file unless NONE is specified --- cmd/dcat/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index d5dfba4..43549b3 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -26,10 +26,11 @@ func main() { flag.BoolVar(&args.Spartan, "spartan", false, "Spartan output mode") flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Trust all unknown host keys") flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.IntVar(&args.ConnectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") - flag.IntVar(&args.SSHPort, "port", 2222, "SSH server port") + flag.IntVar(&args.ConnectionsPerCPU, "cpc", config.DefaultConnectionsPerCPU, "How many connections established per CPU core concurrently") + flag.IntVar(&args.SSHPort, "port", config.DefaultSSHPort, "SSH server port") flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") + flag.StringVar(&args.LogDir, "logDir", "", "Log dir") flag.StringVar(&args.LogLevel, "logLevel", "", "Log level") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") -- cgit v1.2.3 From 6e1af993924bc7bebe898b403962db5a6b3505d1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Oct 2021 11:23:08 +0300 Subject: Client default log dir is ~/log --- cmd/dcat/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 43549b3..21946f6 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -10,6 +10,7 @@ import ( "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/dlog" "github.com/mimecast/dtail/internal/io/signal" + "github.com/mimecast/dtail/internal/source" "github.com/mimecast/dtail/internal/user" "github.com/mimecast/dtail/internal/version" ) @@ -30,7 +31,7 @@ func main() { flag.IntVar(&args.SSHPort, "port", config.DefaultSSHPort, "SSH server port") flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") - flag.StringVar(&args.LogDir, "logDir", "", "Log dir") + flag.StringVar(&args.LogDir, "logDir", "~/log", "Log dir") flag.StringVar(&args.LogLevel, "logLevel", "", "Log level") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") @@ -50,7 +51,7 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup wg.Add(1) - dlog.Start(ctx, &wg, dlog.CLIENT, config.Common.LogLevel) + dlog.Start(ctx, &wg, source.Client, config.Common.LogLevel) client, err := clients.NewCatClient(args) if err != nil { -- cgit v1.2.3 From 86ec83754e0ee7153ad55091f7b6da448bc529c5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Oct 2021 13:44:27 +0300 Subject: add dcat test --- cmd/dcat/testdata.txt | 500 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 500 insertions(+) create mode 100644 cmd/dcat/testdata.txt (limited to 'cmd/dcat') diff --git a/cmd/dcat/testdata.txt b/cmd/dcat/testdata.txt new file mode 100644 index 0000000..9e80424 --- /dev/null +++ b/cmd/dcat/testdata.txt @@ -0,0 +1,500 @@ +1 Sat 2 Oct 13:46:45 EEST 2021 +2 Sat 2 Oct 13:46:45 EEST 2021 +3 Sat 2 Oct 13:46:45 EEST 2021 +4 Sat 2 Oct 13:46:45 EEST 2021 +5 Sat 2 Oct 13:46:45 EEST 2021 +6 Sat 2 Oct 13:46:45 EEST 2021 +7 Sat 2 Oct 13:46:45 EEST 2021 +8 Sat 2 Oct 13:46:45 EEST 2021 +9 Sat 2 Oct 13:46:45 EEST 2021 +10 Sat 2 Oct 13:46:45 EEST 2021 +11 Sat 2 Oct 13:46:45 EEST 2021 +12 Sat 2 Oct 13:46:45 EEST 2021 +13 Sat 2 Oct 13:46:45 EEST 2021 +14 Sat 2 Oct 13:46:45 EEST 2021 +15 Sat 2 Oct 13:46:45 EEST 2021 +16 Sat 2 Oct 13:46:45 EEST 2021 +17 Sat 2 Oct 13:46:45 EEST 2021 +18 Sat 2 Oct 13:46:45 EEST 2021 +19 Sat 2 Oct 13:46:45 EEST 2021 +20 Sat 2 Oct 13:46:45 EEST 2021 +21 Sat 2 Oct 13:46:45 EEST 2021 +22 Sat 2 Oct 13:46:45 EEST 2021 +23 Sat 2 Oct 13:46:45 EEST 2021 +24 Sat 2 Oct 13:46:45 EEST 2021 +25 Sat 2 Oct 13:46:45 EEST 2021 +26 Sat 2 Oct 13:46:45 EEST 2021 +27 Sat 2 Oct 13:46:45 EEST 2021 +28 Sat 2 Oct 13:46:45 EEST 2021 +29 Sat 2 Oct 13:46:45 EEST 2021 +30 Sat 2 Oct 13:46:45 EEST 2021 +31 Sat 2 Oct 13:46:45 EEST 2021 +32 Sat 2 Oct 13:46:45 EEST 2021 +33 Sat 2 Oct 13:46:45 EEST 2021 +34 Sat 2 Oct 13:46:45 EEST 2021 +35 Sat 2 Oct 13:46:45 EEST 2021 +36 Sat 2 Oct 13:46:45 EEST 2021 +37 Sat 2 Oct 13:46:45 EEST 2021 +38 Sat 2 Oct 13:46:45 EEST 2021 +39 Sat 2 Oct 13:46:45 EEST 2021 +40 Sat 2 Oct 13:46:45 EEST 2021 +41 Sat 2 Oct 13:46:45 EEST 2021 +42 Sat 2 Oct 13:46:45 EEST 2021 +43 Sat 2 Oct 13:46:45 EEST 2021 +44 Sat 2 Oct 13:46:45 EEST 2021 +45 Sat 2 Oct 13:46:45 EEST 2021 +46 Sat 2 Oct 13:46:45 EEST 2021 +47 Sat 2 Oct 13:46:45 EEST 2021 +48 Sat 2 Oct 13:46:45 EEST 2021 +49 Sat 2 Oct 13:46:45 EEST 2021 +50 Sat 2 Oct 13:46:45 EEST 2021 +51 Sat 2 Oct 13:46:45 EEST 2021 +52 Sat 2 Oct 13:46:45 EEST 2021 +53 Sat 2 Oct 13:46:45 EEST 2021 +54 Sat 2 Oct 13:46:45 EEST 2021 +55 Sat 2 Oct 13:46:45 EEST 2021 +56 Sat 2 Oct 13:46:45 EEST 2021 +57 Sat 2 Oct 13:46:45 EEST 2021 +58 Sat 2 Oct 13:46:45 EEST 2021 +59 Sat 2 Oct 13:46:45 EEST 2021 +60 Sat 2 Oct 13:46:45 EEST 2021 +61 Sat 2 Oct 13:46:45 EEST 2021 +62 Sat 2 Oct 13:46:45 EEST 2021 +63 Sat 2 Oct 13:46:45 EEST 2021 +64 Sat 2 Oct 13:46:45 EEST 2021 +65 Sat 2 Oct 13:46:45 EEST 2021 +66 Sat 2 Oct 13:46:45 EEST 2021 +67 Sat 2 Oct 13:46:45 EEST 2021 +68 Sat 2 Oct 13:46:45 EEST 2021 +69 Sat 2 Oct 13:46:45 EEST 2021 +70 Sat 2 Oct 13:46:45 EEST 2021 +71 Sat 2 Oct 13:46:45 EEST 2021 +72 Sat 2 Oct 13:46:45 EEST 2021 +73 Sat 2 Oct 13:46:45 EEST 2021 +74 Sat 2 Oct 13:46:45 EEST 2021 +75 Sat 2 Oct 13:46:45 EEST 2021 +76 Sat 2 Oct 13:46:45 EEST 2021 +77 Sat 2 Oct 13:46:45 EEST 2021 +78 Sat 2 Oct 13:46:45 EEST 2021 +79 Sat 2 Oct 13:46:45 EEST 2021 +80 Sat 2 Oct 13:46:45 EEST 2021 +81 Sat 2 Oct 13:46:45 EEST 2021 +82 Sat 2 Oct 13:46:45 EEST 2021 +83 Sat 2 Oct 13:46:45 EEST 2021 +84 Sat 2 Oct 13:46:45 EEST 2021 +85 Sat 2 Oct 13:46:45 EEST 2021 +86 Sat 2 Oct 13:46:45 EEST 2021 +87 Sat 2 Oct 13:46:45 EEST 2021 +88 Sat 2 Oct 13:46:45 EEST 2021 +89 Sat 2 Oct 13:46:45 EEST 2021 +90 Sat 2 Oct 13:46:45 EEST 2021 +91 Sat 2 Oct 13:46:45 EEST 2021 +92 Sat 2 Oct 13:46:45 EEST 2021 +93 Sat 2 Oct 13:46:45 EEST 2021 +94 Sat 2 Oct 13:46:45 EEST 2021 +95 Sat 2 Oct 13:46:45 EEST 2021 +96 Sat 2 Oct 13:46:45 EEST 2021 +97 Sat 2 Oct 13:46:45 EEST 2021 +98 Sat 2 Oct 13:46:45 EEST 2021 +99 Sat 2 Oct 13:46:45 EEST 2021 +100 Sat 2 Oct 13:46:45 EEST 2021 +101 Sat 2 Oct 13:46:45 EEST 2021 +102 Sat 2 Oct 13:46:45 EEST 2021 +103 Sat 2 Oct 13:46:45 EEST 2021 +104 Sat 2 Oct 13:46:45 EEST 2021 +105 Sat 2 Oct 13:46:45 EEST 2021 +106 Sat 2 Oct 13:46:45 EEST 2021 +107 Sat 2 Oct 13:46:45 EEST 2021 +108 Sat 2 Oct 13:46:45 EEST 2021 +109 Sat 2 Oct 13:46:45 EEST 2021 +110 Sat 2 Oct 13:46:45 EEST 2021 +111 Sat 2 Oct 13:46:45 EEST 2021 +112 Sat 2 Oct 13:46:45 EEST 2021 +113 Sat 2 Oct 13:46:45 EEST 2021 +114 Sat 2 Oct 13:46:45 EEST 2021 +115 Sat 2 Oct 13:46:45 EEST 2021 +116 Sat 2 Oct 13:46:45 EEST 2021 +117 Sat 2 Oct 13:46:45 EEST 2021 +118 Sat 2 Oct 13:46:45 EEST 2021 +119 Sat 2 Oct 13:46:45 EEST 2021 +120 Sat 2 Oct 13:46:45 EEST 2021 +121 Sat 2 Oct 13:46:45 EEST 2021 +122 Sat 2 Oct 13:46:45 EEST 2021 +123 Sat 2 Oct 13:46:45 EEST 2021 +124 Sat 2 Oct 13:46:45 EEST 2021 +125 Sat 2 Oct 13:46:45 EEST 2021 +126 Sat 2 Oct 13:46:45 EEST 2021 +127 Sat 2 Oct 13:46:45 EEST 2021 +128 Sat 2 Oct 13:46:45 EEST 2021 +129 Sat 2 Oct 13:46:45 EEST 2021 +130 Sat 2 Oct 13:46:45 EEST 2021 +131 Sat 2 Oct 13:46:45 EEST 2021 +132 Sat 2 Oct 13:46:45 EEST 2021 +133 Sat 2 Oct 13:46:45 EEST 2021 +134 Sat 2 Oct 13:46:45 EEST 2021 +135 Sat 2 Oct 13:46:45 EEST 2021 +136 Sat 2 Oct 13:46:45 EEST 2021 +137 Sat 2 Oct 13:46:45 EEST 2021 +138 Sat 2 Oct 13:46:45 EEST 2021 +139 Sat 2 Oct 13:46:45 EEST 2021 +140 Sat 2 Oct 13:46:45 EEST 2021 +141 Sat 2 Oct 13:46:45 EEST 2021 +142 Sat 2 Oct 13:46:45 EEST 2021 +143 Sat 2 Oct 13:46:45 EEST 2021 +144 Sat 2 Oct 13:46:45 EEST 2021 +145 Sat 2 Oct 13:46:45 EEST 2021 +146 Sat 2 Oct 13:46:45 EEST 2021 +147 Sat 2 Oct 13:46:45 EEST 2021 +148 Sat 2 Oct 13:46:45 EEST 2021 +149 Sat 2 Oct 13:46:45 EEST 2021 +150 Sat 2 Oct 13:46:45 EEST 2021 +151 Sat 2 Oct 13:46:45 EEST 2021 +152 Sat 2 Oct 13:46:45 EEST 2021 +153 Sat 2 Oct 13:46:45 EEST 2021 +154 Sat 2 Oct 13:46:45 EEST 2021 +155 Sat 2 Oct 13:46:45 EEST 2021 +156 Sat 2 Oct 13:46:45 EEST 2021 +157 Sat 2 Oct 13:46:45 EEST 2021 +158 Sat 2 Oct 13:46:45 EEST 2021 +159 Sat 2 Oct 13:46:45 EEST 2021 +160 Sat 2 Oct 13:46:45 EEST 2021 +161 Sat 2 Oct 13:46:45 EEST 2021 +162 Sat 2 Oct 13:46:45 EEST 2021 +163 Sat 2 Oct 13:46:45 EEST 2021 +164 Sat 2 Oct 13:46:45 EEST 2021 +165 Sat 2 Oct 13:46:45 EEST 2021 +166 Sat 2 Oct 13:46:45 EEST 2021 +167 Sat 2 Oct 13:46:45 EEST 2021 +168 Sat 2 Oct 13:46:45 EEST 2021 +169 Sat 2 Oct 13:46:45 EEST 2021 +170 Sat 2 Oct 13:46:45 EEST 2021 +171 Sat 2 Oct 13:46:45 EEST 2021 +172 Sat 2 Oct 13:46:45 EEST 2021 +173 Sat 2 Oct 13:46:45 EEST 2021 +174 Sat 2 Oct 13:46:45 EEST 2021 +175 Sat 2 Oct 13:46:45 EEST 2021 +176 Sat 2 Oct 13:46:45 EEST 2021 +177 Sat 2 Oct 13:46:45 EEST 2021 +178 Sat 2 Oct 13:46:45 EEST 2021 +179 Sat 2 Oct 13:46:45 EEST 2021 +180 Sat 2 Oct 13:46:45 EEST 2021 +181 Sat 2 Oct 13:46:45 EEST 2021 +182 Sat 2 Oct 13:46:45 EEST 2021 +183 Sat 2 Oct 13:46:45 EEST 2021 +184 Sat 2 Oct 13:46:45 EEST 2021 +185 Sat 2 Oct 13:46:45 EEST 2021 +186 Sat 2 Oct 13:46:45 EEST 2021 +187 Sat 2 Oct 13:46:45 EEST 2021 +188 Sat 2 Oct 13:46:45 EEST 2021 +189 Sat 2 Oct 13:46:45 EEST 2021 +190 Sat 2 Oct 13:46:45 EEST 2021 +191 Sat 2 Oct 13:46:45 EEST 2021 +192 Sat 2 Oct 13:46:45 EEST 2021 +193 Sat 2 Oct 13:46:45 EEST 2021 +194 Sat 2 Oct 13:46:45 EEST 2021 +195 Sat 2 Oct 13:46:45 EEST 2021 +196 Sat 2 Oct 13:46:45 EEST 2021 +197 Sat 2 Oct 13:46:45 EEST 2021 +198 Sat 2 Oct 13:46:45 EEST 2021 +199 Sat 2 Oct 13:46:45 EEST 2021 +200 Sat 2 Oct 13:46:45 EEST 2021 +201 Sat 2 Oct 13:46:45 EEST 2021 +202 Sat 2 Oct 13:46:45 EEST 2021 +203 Sat 2 Oct 13:46:45 EEST 2021 +204 Sat 2 Oct 13:46:45 EEST 2021 +205 Sat 2 Oct 13:46:45 EEST 2021 +206 Sat 2 Oct 13:46:45 EEST 2021 +207 Sat 2 Oct 13:46:45 EEST 2021 +208 Sat 2 Oct 13:46:45 EEST 2021 +209 Sat 2 Oct 13:46:45 EEST 2021 +210 Sat 2 Oct 13:46:45 EEST 2021 +211 Sat 2 Oct 13:46:45 EEST 2021 +212 Sat 2 Oct 13:46:45 EEST 2021 +213 Sat 2 Oct 13:46:45 EEST 2021 +214 Sat 2 Oct 13:46:45 EEST 2021 +215 Sat 2 Oct 13:46:45 EEST 2021 +216 Sat 2 Oct 13:46:45 EEST 2021 +217 Sat 2 Oct 13:46:45 EEST 2021 +218 Sat 2 Oct 13:46:45 EEST 2021 +219 Sat 2 Oct 13:46:45 EEST 2021 +220 Sat 2 Oct 13:46:45 EEST 2021 +221 Sat 2 Oct 13:46:45 EEST 2021 +222 Sat 2 Oct 13:46:45 EEST 2021 +223 Sat 2 Oct 13:46:45 EEST 2021 +224 Sat 2 Oct 13:46:45 EEST 2021 +225 Sat 2 Oct 13:46:45 EEST 2021 +226 Sat 2 Oct 13:46:45 EEST 2021 +227 Sat 2 Oct 13:46:45 EEST 2021 +228 Sat 2 Oct 13:46:45 EEST 2021 +229 Sat 2 Oct 13:46:45 EEST 2021 +230 Sat 2 Oct 13:46:45 EEST 2021 +231 Sat 2 Oct 13:46:45 EEST 2021 +232 Sat 2 Oct 13:46:45 EEST 2021 +233 Sat 2 Oct 13:46:45 EEST 2021 +234 Sat 2 Oct 13:46:45 EEST 2021 +235 Sat 2 Oct 13:46:45 EEST 2021 +236 Sat 2 Oct 13:46:45 EEST 2021 +237 Sat 2 Oct 13:46:45 EEST 2021 +238 Sat 2 Oct 13:46:45 EEST 2021 +239 Sat 2 Oct 13:46:45 EEST 2021 +240 Sat 2 Oct 13:46:45 EEST 2021 +241 Sat 2 Oct 13:46:45 EEST 2021 +242 Sat 2 Oct 13:46:45 EEST 2021 +243 Sat 2 Oct 13:46:45 EEST 2021 +244 Sat 2 Oct 13:46:45 EEST 2021 +245 Sat 2 Oct 13:46:45 EEST 2021 +246 Sat 2 Oct 13:46:45 EEST 2021 +247 Sat 2 Oct 13:46:45 EEST 2021 +248 Sat 2 Oct 13:46:45 EEST 2021 +249 Sat 2 Oct 13:46:45 EEST 2021 +250 Sat 2 Oct 13:46:45 EEST 2021 +251 Sat 2 Oct 13:46:45 EEST 2021 +252 Sat 2 Oct 13:46:45 EEST 2021 +253 Sat 2 Oct 13:46:45 EEST 2021 +254 Sat 2 Oct 13:46:45 EEST 2021 +255 Sat 2 Oct 13:46:45 EEST 2021 +256 Sat 2 Oct 13:46:45 EEST 2021 +257 Sat 2 Oct 13:46:45 EEST 2021 +258 Sat 2 Oct 13:46:45 EEST 2021 +259 Sat 2 Oct 13:46:45 EEST 2021 +260 Sat 2 Oct 13:46:45 EEST 2021 +261 Sat 2 Oct 13:46:45 EEST 2021 +262 Sat 2 Oct 13:46:45 EEST 2021 +263 Sat 2 Oct 13:46:45 EEST 2021 +264 Sat 2 Oct 13:46:45 EEST 2021 +265 Sat 2 Oct 13:46:45 EEST 2021 +266 Sat 2 Oct 13:46:45 EEST 2021 +267 Sat 2 Oct 13:46:45 EEST 2021 +268 Sat 2 Oct 13:46:45 EEST 2021 +269 Sat 2 Oct 13:46:45 EEST 2021 +270 Sat 2 Oct 13:46:45 EEST 2021 +271 Sat 2 Oct 13:46:45 EEST 2021 +272 Sat 2 Oct 13:46:45 EEST 2021 +273 Sat 2 Oct 13:46:45 EEST 2021 +274 Sat 2 Oct 13:46:45 EEST 2021 +275 Sat 2 Oct 13:46:45 EEST 2021 +276 Sat 2 Oct 13:46:45 EEST 2021 +277 Sat 2 Oct 13:46:45 EEST 2021 +278 Sat 2 Oct 13:46:45 EEST 2021 +279 Sat 2 Oct 13:46:45 EEST 2021 +280 Sat 2 Oct 13:46:45 EEST 2021 +281 Sat 2 Oct 13:46:45 EEST 2021 +282 Sat 2 Oct 13:46:45 EEST 2021 +283 Sat 2 Oct 13:46:45 EEST 2021 +284 Sat 2 Oct 13:46:45 EEST 2021 +285 Sat 2 Oct 13:46:45 EEST 2021 +286 Sat 2 Oct 13:46:45 EEST 2021 +287 Sat 2 Oct 13:46:45 EEST 2021 +288 Sat 2 Oct 13:46:45 EEST 2021 +289 Sat 2 Oct 13:46:45 EEST 2021 +290 Sat 2 Oct 13:46:45 EEST 2021 +291 Sat 2 Oct 13:46:45 EEST 2021 +292 Sat 2 Oct 13:46:45 EEST 2021 +293 Sat 2 Oct 13:46:45 EEST 2021 +294 Sat 2 Oct 13:46:45 EEST 2021 +295 Sat 2 Oct 13:46:45 EEST 2021 +296 Sat 2 Oct 13:46:45 EEST 2021 +297 Sat 2 Oct 13:46:45 EEST 2021 +298 Sat 2 Oct 13:46:45 EEST 2021 +299 Sat 2 Oct 13:46:45 EEST 2021 +300 Sat 2 Oct 13:46:45 EEST 2021 +301 Sat 2 Oct 13:46:45 EEST 2021 +302 Sat 2 Oct 13:46:45 EEST 2021 +303 Sat 2 Oct 13:46:45 EEST 2021 +304 Sat 2 Oct 13:46:45 EEST 2021 +305 Sat 2 Oct 13:46:45 EEST 2021 +306 Sat 2 Oct 13:46:45 EEST 2021 +307 Sat 2 Oct 13:46:45 EEST 2021 +308 Sat 2 Oct 13:46:45 EEST 2021 +309 Sat 2 Oct 13:46:45 EEST 2021 +310 Sat 2 Oct 13:46:45 EEST 2021 +311 Sat 2 Oct 13:46:45 EEST 2021 +312 Sat 2 Oct 13:46:45 EEST 2021 +313 Sat 2 Oct 13:46:45 EEST 2021 +314 Sat 2 Oct 13:46:45 EEST 2021 +315 Sat 2 Oct 13:46:45 EEST 2021 +316 Sat 2 Oct 13:46:45 EEST 2021 +317 Sat 2 Oct 13:46:45 EEST 2021 +318 Sat 2 Oct 13:46:45 EEST 2021 +319 Sat 2 Oct 13:46:45 EEST 2021 +320 Sat 2 Oct 13:46:45 EEST 2021 +321 Sat 2 Oct 13:46:45 EEST 2021 +322 Sat 2 Oct 13:46:45 EEST 2021 +323 Sat 2 Oct 13:46:45 EEST 2021 +324 Sat 2 Oct 13:46:45 EEST 2021 +325 Sat 2 Oct 13:46:45 EEST 2021 +326 Sat 2 Oct 13:46:45 EEST 2021 +327 Sat 2 Oct 13:46:45 EEST 2021 +328 Sat 2 Oct 13:46:45 EEST 2021 +329 Sat 2 Oct 13:46:45 EEST 2021 +330 Sat 2 Oct 13:46:46 EEST 2021 +331 Sat 2 Oct 13:46:46 EEST 2021 +332 Sat 2 Oct 13:46:46 EEST 2021 +333 Sat 2 Oct 13:46:46 EEST 2021 +334 Sat 2 Oct 13:46:46 EEST 2021 +335 Sat 2 Oct 13:46:46 EEST 2021 +336 Sat 2 Oct 13:46:46 EEST 2021 +337 Sat 2 Oct 13:46:46 EEST 2021 +338 Sat 2 Oct 13:46:46 EEST 2021 +339 Sat 2 Oct 13:46:46 EEST 2021 +340 Sat 2 Oct 13:46:46 EEST 2021 +341 Sat 2 Oct 13:46:46 EEST 2021 +342 Sat 2 Oct 13:46:46 EEST 2021 +343 Sat 2 Oct 13:46:46 EEST 2021 +344 Sat 2 Oct 13:46:46 EEST 2021 +345 Sat 2 Oct 13:46:46 EEST 2021 +346 Sat 2 Oct 13:46:46 EEST 2021 +347 Sat 2 Oct 13:46:46 EEST 2021 +348 Sat 2 Oct 13:46:46 EEST 2021 +349 Sat 2 Oct 13:46:46 EEST 2021 +350 Sat 2 Oct 13:46:46 EEST 2021 +351 Sat 2 Oct 13:46:46 EEST 2021 +352 Sat 2 Oct 13:46:46 EEST 2021 +353 Sat 2 Oct 13:46:46 EEST 2021 +354 Sat 2 Oct 13:46:46 EEST 2021 +355 Sat 2 Oct 13:46:46 EEST 2021 +356 Sat 2 Oct 13:46:46 EEST 2021 +357 Sat 2 Oct 13:46:46 EEST 2021 +358 Sat 2 Oct 13:46:46 EEST 2021 +359 Sat 2 Oct 13:46:46 EEST 2021 +360 Sat 2 Oct 13:46:46 EEST 2021 +361 Sat 2 Oct 13:46:46 EEST 2021 +362 Sat 2 Oct 13:46:46 EEST 2021 +363 Sat 2 Oct 13:46:46 EEST 2021 +364 Sat 2 Oct 13:46:46 EEST 2021 +365 Sat 2 Oct 13:46:46 EEST 2021 +366 Sat 2 Oct 13:46:46 EEST 2021 +367 Sat 2 Oct 13:46:46 EEST 2021 +368 Sat 2 Oct 13:46:46 EEST 2021 +369 Sat 2 Oct 13:46:46 EEST 2021 +370 Sat 2 Oct 13:46:46 EEST 2021 +371 Sat 2 Oct 13:46:46 EEST 2021 +372 Sat 2 Oct 13:46:46 EEST 2021 +373 Sat 2 Oct 13:46:46 EEST 2021 +374 Sat 2 Oct 13:46:46 EEST 2021 +375 Sat 2 Oct 13:46:46 EEST 2021 +376 Sat 2 Oct 13:46:46 EEST 2021 +377 Sat 2 Oct 13:46:46 EEST 2021 +378 Sat 2 Oct 13:46:46 EEST 2021 +379 Sat 2 Oct 13:46:46 EEST 2021 +380 Sat 2 Oct 13:46:46 EEST 2021 +381 Sat 2 Oct 13:46:46 EEST 2021 +382 Sat 2 Oct 13:46:46 EEST 2021 +383 Sat 2 Oct 13:46:46 EEST 2021 +384 Sat 2 Oct 13:46:46 EEST 2021 +385 Sat 2 Oct 13:46:46 EEST 2021 +386 Sat 2 Oct 13:46:46 EEST 2021 +387 Sat 2 Oct 13:46:46 EEST 2021 +388 Sat 2 Oct 13:46:46 EEST 2021 +389 Sat 2 Oct 13:46:46 EEST 2021 +390 Sat 2 Oct 13:46:46 EEST 2021 +391 Sat 2 Oct 13:46:46 EEST 2021 +392 Sat 2 Oct 13:46:46 EEST 2021 +393 Sat 2 Oct 13:46:46 EEST 2021 +394 Sat 2 Oct 13:46:46 EEST 2021 +395 Sat 2 Oct 13:46:46 EEST 2021 +396 Sat 2 Oct 13:46:46 EEST 2021 +397 Sat 2 Oct 13:46:46 EEST 2021 +398 Sat 2 Oct 13:46:46 EEST 2021 +399 Sat 2 Oct 13:46:46 EEST 2021 +400 Sat 2 Oct 13:46:46 EEST 2021 +401 Sat 2 Oct 13:46:46 EEST 2021 +402 Sat 2 Oct 13:46:46 EEST 2021 +403 Sat 2 Oct 13:46:46 EEST 2021 +404 Sat 2 Oct 13:46:46 EEST 2021 +405 Sat 2 Oct 13:46:46 EEST 2021 +406 Sat 2 Oct 13:46:46 EEST 2021 +407 Sat 2 Oct 13:46:46 EEST 2021 +408 Sat 2 Oct 13:46:46 EEST 2021 +409 Sat 2 Oct 13:46:46 EEST 2021 +410 Sat 2 Oct 13:46:46 EEST 2021 +411 Sat 2 Oct 13:46:46 EEST 2021 +412 Sat 2 Oct 13:46:46 EEST 2021 +413 Sat 2 Oct 13:46:46 EEST 2021 +414 Sat 2 Oct 13:46:46 EEST 2021 +415 Sat 2 Oct 13:46:46 EEST 2021 +416 Sat 2 Oct 13:46:46 EEST 2021 +417 Sat 2 Oct 13:46:46 EEST 2021 +418 Sat 2 Oct 13:46:46 EEST 2021 +419 Sat 2 Oct 13:46:46 EEST 2021 +420 Sat 2 Oct 13:46:46 EEST 2021 +421 Sat 2 Oct 13:46:46 EEST 2021 +422 Sat 2 Oct 13:46:46 EEST 2021 +423 Sat 2 Oct 13:46:46 EEST 2021 +424 Sat 2 Oct 13:46:46 EEST 2021 +425 Sat 2 Oct 13:46:46 EEST 2021 +426 Sat 2 Oct 13:46:46 EEST 2021 +427 Sat 2 Oct 13:46:46 EEST 2021 +428 Sat 2 Oct 13:46:46 EEST 2021 +429 Sat 2 Oct 13:46:46 EEST 2021 +430 Sat 2 Oct 13:46:46 EEST 2021 +431 Sat 2 Oct 13:46:46 EEST 2021 +432 Sat 2 Oct 13:46:46 EEST 2021 +433 Sat 2 Oct 13:46:46 EEST 2021 +434 Sat 2 Oct 13:46:46 EEST 2021 +435 Sat 2 Oct 13:46:46 EEST 2021 +436 Sat 2 Oct 13:46:46 EEST 2021 +437 Sat 2 Oct 13:46:46 EEST 2021 +438 Sat 2 Oct 13:46:46 EEST 2021 +439 Sat 2 Oct 13:46:46 EEST 2021 +440 Sat 2 Oct 13:46:46 EEST 2021 +441 Sat 2 Oct 13:46:46 EEST 2021 +442 Sat 2 Oct 13:46:46 EEST 2021 +443 Sat 2 Oct 13:46:46 EEST 2021 +444 Sat 2 Oct 13:46:46 EEST 2021 +445 Sat 2 Oct 13:46:46 EEST 2021 +446 Sat 2 Oct 13:46:46 EEST 2021 +447 Sat 2 Oct 13:46:46 EEST 2021 +448 Sat 2 Oct 13:46:46 EEST 2021 +449 Sat 2 Oct 13:46:46 EEST 2021 +450 Sat 2 Oct 13:46:46 EEST 2021 +451 Sat 2 Oct 13:46:46 EEST 2021 +452 Sat 2 Oct 13:46:46 EEST 2021 +453 Sat 2 Oct 13:46:46 EEST 2021 +454 Sat 2 Oct 13:46:46 EEST 2021 +455 Sat 2 Oct 13:46:46 EEST 2021 +456 Sat 2 Oct 13:46:46 EEST 2021 +457 Sat 2 Oct 13:46:46 EEST 2021 +458 Sat 2 Oct 13:46:46 EEST 2021 +459 Sat 2 Oct 13:46:46 EEST 2021 +460 Sat 2 Oct 13:46:46 EEST 2021 +461 Sat 2 Oct 13:46:46 EEST 2021 +462 Sat 2 Oct 13:46:46 EEST 2021 +463 Sat 2 Oct 13:46:46 EEST 2021 +464 Sat 2 Oct 13:46:46 EEST 2021 +465 Sat 2 Oct 13:46:46 EEST 2021 +466 Sat 2 Oct 13:46:46 EEST 2021 +467 Sat 2 Oct 13:46:46 EEST 2021 +468 Sat 2 Oct 13:46:46 EEST 2021 +469 Sat 2 Oct 13:46:46 EEST 2021 +470 Sat 2 Oct 13:46:46 EEST 2021 +471 Sat 2 Oct 13:46:46 EEST 2021 +472 Sat 2 Oct 13:46:46 EEST 2021 +473 Sat 2 Oct 13:46:46 EEST 2021 +474 Sat 2 Oct 13:46:46 EEST 2021 +475 Sat 2 Oct 13:46:46 EEST 2021 +476 Sat 2 Oct 13:46:46 EEST 2021 +477 Sat 2 Oct 13:46:46 EEST 2021 +478 Sat 2 Oct 13:46:46 EEST 2021 +479 Sat 2 Oct 13:46:46 EEST 2021 +480 Sat 2 Oct 13:46:46 EEST 2021 +481 Sat 2 Oct 13:46:46 EEST 2021 +482 Sat 2 Oct 13:46:46 EEST 2021 +483 Sat 2 Oct 13:46:46 EEST 2021 +484 Sat 2 Oct 13:46:46 EEST 2021 +485 Sat 2 Oct 13:46:46 EEST 2021 +486 Sat 2 Oct 13:46:46 EEST 2021 +487 Sat 2 Oct 13:46:46 EEST 2021 +488 Sat 2 Oct 13:46:46 EEST 2021 +489 Sat 2 Oct 13:46:46 EEST 2021 +490 Sat 2 Oct 13:46:46 EEST 2021 +491 Sat 2 Oct 13:46:46 EEST 2021 +492 Sat 2 Oct 13:46:46 EEST 2021 +493 Sat 2 Oct 13:46:46 EEST 2021 +494 Sat 2 Oct 13:46:46 EEST 2021 +495 Sat 2 Oct 13:46:46 EEST 2021 +496 Sat 2 Oct 13:46:46 EEST 2021 +497 Sat 2 Oct 13:46:46 EEST 2021 +498 Sat 2 Oct 13:46:46 EEST 2021 +499 Sat 2 Oct 13:46:46 EEST 2021 +500 Sat 2 Oct 13:46:46 EEST 2021 -- cgit v1.2.3 From 07e1470892beacf0722276f94bacbd822b002540 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 3 Oct 2021 13:09:32 +0300 Subject: add dmap tests --- cmd/dcat/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 21946f6..9fe776b 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -39,7 +39,7 @@ func main() { flag.StringVar(&args.What, "files", "", "File(s) to read") flag.Parse() - config.Setup(&args, flag.Args()) + config.Setup(source.Client, &args, flag.Args()) if displayVersion { version.PrintAndExit() -- cgit v1.2.3 From 9f395a03f25941d8ed98ec43035688daa1e8877f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 5 Oct 2021 22:39:58 +0300 Subject: more on this --- cmd/dcat/main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 9fe776b..ee851ab 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -3,9 +3,14 @@ package main import ( "context" "flag" + "fmt" "os" "sync" + "net/http" + _ "net/http" + _ "net/http/pprof" + "github.com/mimecast/dtail/internal/clients" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/io/dlog" @@ -19,6 +24,7 @@ import ( func main() { var args config.Args var displayVersion bool + var pprof int userName := user.Name() @@ -29,6 +35,7 @@ func main() { flag.BoolVar(&displayVersion, "version", false, "Display version") flag.IntVar(&args.ConnectionsPerCPU, "cpc", config.DefaultConnectionsPerCPU, "How many connections established per CPU core concurrently") flag.IntVar(&args.SSHPort, "port", config.DefaultSSHPort, "SSH server port") + flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") flag.StringVar(&args.LogDir, "logDir", "~/log", "Log dir") @@ -53,6 +60,13 @@ func main() { wg.Add(1) dlog.Start(ctx, &wg, source.Client, config.Common.LogLevel) + if pprof > -1 { + // For debugging purposes only + pprofArgs := fmt.Sprintf("0.0.0.0:%d", pprof) + go http.ListenAndServe(pprofArgs, nil) + dlog.Client.Info("Started PProf", pprofArgs) + } + client, err := clients.NewCatClient(args) if err != nil { panic(err) -- cgit v1.2.3 From 2d7ddbeae8286373ac19787dc7dde598a7cb0598 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 Oct 2021 11:43:43 +0300 Subject: refactor --- cmd/dcat/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index ee851ab..662a50d 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -39,6 +39,7 @@ func main() { flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") flag.StringVar(&args.LogDir, "logDir", "~/log", "Log dir") + flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", "", "Log level") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") @@ -58,7 +59,7 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup wg.Add(1) - dlog.Start(ctx, &wg, source.Client, config.Common.LogLevel) + dlog.Start(ctx, &wg, source.Client) if pprof > -1 { // For debugging purposes only -- cgit v1.2.3 From 97747ea0f3178f7f5890512d483fdccaa82846b0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 9 Oct 2021 21:10:29 +0300 Subject: vetting and linting and some code restyling --- cmd/dcat/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 662a50d..87ece9d 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -33,7 +33,8 @@ func main() { flag.BoolVar(&args.Spartan, "spartan", false, "Spartan output mode") flag.BoolVar(&args.TrustAllHosts, "trustAllHosts", false, "Trust all unknown host keys") flag.BoolVar(&displayVersion, "version", false, "Display version") - flag.IntVar(&args.ConnectionsPerCPU, "cpc", config.DefaultConnectionsPerCPU, "How many connections established per CPU core concurrently") + flag.IntVar(&args.ConnectionsPerCPU, "cpc", config.DefaultConnectionsPerCPU, + "How many connections established per CPU core concurrently") flag.IntVar(&args.SSHPort, "port", config.DefaultSSHPort, "SSH server port") flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") -- cgit v1.2.3 From f44792c9102488774c9993b080f35c65287a64b1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 10 Oct 2021 14:02:12 +0300 Subject: add another dmap test - reading 100 source files at once fix a data race when reading multiple files on one server from the same session at once --- cmd/dcat/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 87ece9d..5851acc 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -41,7 +41,7 @@ func main() { flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") flag.StringVar(&args.LogDir, "logDir", "~/log", "Log dir") flag.StringVar(&args.Logger, "logger", config.DefaultClientLogger, "Logger name") - flag.StringVar(&args.LogLevel, "logLevel", "", "Log level") + flag.StringVar(&args.LogLevel, "logLevel", config.DefaultLogLevel, "Log level") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") -- cgit v1.2.3 From c0332e8fa13f4939de17c856b2e71fd093847253 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 15 Oct 2021 09:04:40 +0300 Subject: add dcat color output test --- cmd/dcat/main.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 5851acc..5e35d6f 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -53,9 +53,6 @@ func main() { if displayVersion { version.PrintAndExit() } - if !args.Spartan { - version.Print() - } ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup -- cgit v1.2.3 From b679462fa687b375ccefd3c11fec3fd96b9b4d60 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 20 Oct 2021 06:41:08 +0300 Subject: make pprof bind address configurable --- cmd/dcat/main.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'cmd/dcat') diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 5e35d6f..5fd22ea 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -3,7 +3,6 @@ package main import ( "context" "flag" - "fmt" "os" "sync" @@ -24,7 +23,7 @@ import ( func main() { var args config.Args var displayVersion bool - var pprof int + var pprof string userName := user.Name() @@ -36,7 +35,6 @@ func main() { flag.IntVar(&args.ConnectionsPerCPU, "cpc", config.DefaultConnectionsPerCPU, "How many connections established per CPU core concurrently") flag.IntVar(&args.SSHPort, "port", config.DefaultSSHPort, "SSH server port") - flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.StringVar(&args.ConfigFile, "cfg", "", "Config file path") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") flag.StringVar(&args.LogDir, "logDir", "~/log", "Log dir") @@ -46,6 +44,7 @@ func main() { flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") + flag.StringVar(&pprof, "pprof", "", "Start PProf server this address") flag.Parse() config.Setup(source.Client, &args, flag.Args()) @@ -59,11 +58,9 @@ func main() { wg.Add(1) dlog.Start(ctx, &wg, source.Client) - if pprof > -1 { - // For debugging purposes only - pprofArgs := fmt.Sprintf("0.0.0.0:%d", pprof) - go http.ListenAndServe(pprofArgs, nil) - dlog.Client.Info("Started PProf", pprofArgs) + if pprof != "" { + go http.ListenAndServe(pprof, nil) + dlog.Client.Info("Started PProf", pprof) } client, err := clients.NewCatClient(args) -- cgit v1.2.3