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 --- internal/version/version.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index c0f349c..7c206b4 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -5,6 +5,7 @@ import ( "os" "github.com/mimecast/dtail/internal/color" + "github.com/mimecast/dtail/internal/config" ) const ( @@ -25,7 +26,7 @@ func String() string { // PaintedString is a prettier string representation of the DTail version. func PaintedString() string { - if !color.Colored { + if !config.Client.TermColorsEnabled { return String() } name := color.Paint(color.Yellow, Name) -- cgit v1.2.3 From f3e08046badcbc852a6875b5553ee0a648021552 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 10 Aug 2021 12:05:40 +0300 Subject: can compile with new color codes --- internal/version/version.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 7c206b4..a513fdc 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -13,10 +13,10 @@ const ( Name string = "DTail" // Version of DTail. Version string = "3.2.0" - // Additional information for DTail - Additional string = "" // ProtocolCompat -ibility version. ProtocolCompat string = "3" + // Additional information for DTail + Additional string = "Have a lot of fun!" ) // String representation of the DTail version. @@ -29,11 +29,20 @@ func PaintedString() string { if !config.Client.TermColorsEnabled { return String() } - name := color.Paint(color.Yellow, Name) - version := color.Paint(color.Blue, Version) - descr := color.Paint(color.Green, Additional) - return fmt.Sprintf("%s %v Protocol %s %s", name, version, ProtocolCompat, descr) + name := color.PaintWithAttr(Name, + color.FgYellow, color.BgBlue, color.AttrBold) + + version := color.PaintWithAttr(fmt.Sprintf(" %s ", Version), + color.FgBlue, color.BgYellow, color.AttrBold) + + protocol := color.Paint(fmt.Sprintf(" Protocol %s ", ProtocolCompat), + color.FgBlack, color.BgGreen) + + additional := color.PaintWithAttr(fmt.Sprintf(" %s ", Additional), + color.FgWhite, color.BgMagenta, color.AttrBlink) + + return fmt.Sprintf("%s%v%s%s", name, version, protocol, additional) } // PrintAndExit prints the program version and exists. -- cgit v1.2.3 From 9bb96433be61d89f8e86f6f9ded8e35f74156a63 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 11 Aug 2021 09:32:13 +0300 Subject: add colorTable option --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index a513fdc..7cfe12c 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -30,7 +30,7 @@ func PaintedString() string { return String() } - name := color.PaintWithAttr(Name, + name := color.PaintWithAttr(fmt.Sprintf(" %s ", Name), color.FgYellow, color.BgBlue, color.AttrBold) version := color.PaintWithAttr(fmt.Sprintf(" %s ", Version), -- 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 --- internal/version/version.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 7cfe12c..3e683bd 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -26,7 +26,7 @@ func String() string { // PaintedString is a prettier string representation of the DTail version. func PaintedString() string { - if !config.Client.TermColorsEnabled { + if !config.Client.TermColorsEnable { return String() } @@ -45,8 +45,13 @@ func PaintedString() string { return fmt.Sprintf("%s%v%s%s", name, version, protocol, additional) } +// Print the version. +func Print() { + fmt.Println(PaintedString()) +} + // PrintAndExit prints the program version and exists. func PrintAndExit() { - fmt.Println(PaintedString()) + Print() os.Exit(0) } -- cgit v1.2.3 From c2522ffb59514443816a96386c16bb7527cbe57c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Aug 2021 14:54:24 +0300 Subject: read files bytewise for more control of whats happening - change transport protocol for more control over newlines --- internal/version/version.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 3e683bd..7f07c83 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -6,6 +6,7 @@ import ( "github.com/mimecast/dtail/internal/color" "github.com/mimecast/dtail/internal/config" + "github.com/mimecast/dtail/internal/protocol" ) const ( @@ -13,15 +14,13 @@ const ( Name string = "DTail" // Version of DTail. Version string = "3.2.0" - // ProtocolCompat -ibility version. - ProtocolCompat string = "3" // Additional information for DTail Additional string = "Have a lot of fun!" ) // String representation of the DTail version. func String() string { - return fmt.Sprintf("%s %v Protocol %s %s", Name, Version, ProtocolCompat, Additional) + return fmt.Sprintf("%s %v Protocol %s %s", Name, Version, protocol.ProtocolCompat, Additional) } // PaintedString is a prettier string representation of the DTail version. @@ -36,7 +35,7 @@ func PaintedString() string { version := color.PaintWithAttr(fmt.Sprintf(" %s ", Version), color.FgBlue, color.BgYellow, color.AttrBold) - protocol := color.Paint(fmt.Sprintf(" Protocol %s ", ProtocolCompat), + protocol := color.Paint(fmt.Sprintf(" Protocol %s ", protocol.ProtocolCompat), color.FgBlack, color.BgGreen) additional := color.PaintWithAttr(fmt.Sprintf(" %s ", Additional), -- cgit v1.2.3 From bfcb0f159a4835cc6a0326ff46de7934e0363aed Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 5 Sep 2021 15:51:26 +0300 Subject: finalize new default color schema --- internal/version/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 7f07c83..693192f 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -29,16 +29,16 @@ func PaintedString() string { return String() } - name := color.PaintWithAttr(fmt.Sprintf(" %s ", Name), + name := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Name), color.FgYellow, color.BgBlue, color.AttrBold) - version := color.PaintWithAttr(fmt.Sprintf(" %s ", Version), + version := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Version), color.FgBlue, color.BgYellow, color.AttrBold) - protocol := color.Paint(fmt.Sprintf(" Protocol %s ", protocol.ProtocolCompat), + protocol := color.PaintStr(fmt.Sprintf(" Protocol %s ", protocol.ProtocolCompat), color.FgBlack, color.BgGreen) - additional := color.PaintWithAttr(fmt.Sprintf(" %s ", Additional), + additional := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Additional), color.FgWhite, color.BgMagenta, color.AttrBlink) return fmt.Sprintf("%s%v%s%s", name, version, protocol, additional) -- cgit v1.2.3 From f74a9e4b35feb8c07d8a70b5a581088a0a59889d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 7 Sep 2021 10:01:32 +0300 Subject: Produce MAPREDUCE lines, can aggregate these via default log format --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 693192f..a54b560 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -13,7 +13,7 @@ const ( // Name of DTail. Name string = "DTail" // Version of DTail. - Version string = "3.2.0" + Version string = "4.0.0-RC1" // Additional information for DTail Additional string = "Have a lot of fun!" ) -- cgit v1.2.3 From 12c79f68bb5bda6673819d7b754820ecfe6d08ff Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Oct 2021 11:54:07 +0300 Subject: reduce logging in serverless mode --- internal/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index a54b560..4ff6eae 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -39,7 +39,7 @@ func PaintedString() string { color.FgBlack, color.BgGreen) additional := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Additional), - color.FgWhite, color.BgMagenta, color.AttrBlink) + color.FgWhite, color.BgMagenta, color.AttrUnderline) return fmt.Sprintf("%s%v%s%s", name, version, protocol, additional) } -- 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 --- internal/version/version.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/version') diff --git a/internal/version/version.go b/internal/version/version.go index 4ff6eae..68b9e6e 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -20,7 +20,8 @@ const ( // String representation of the DTail version. func String() string { - return fmt.Sprintf("%s %v Protocol %s %s", Name, Version, protocol.ProtocolCompat, Additional) + return fmt.Sprintf("%s %v Protocol %s %s", Name, Version, + protocol.ProtocolCompat, Additional) } // PaintedString is a prettier string representation of the DTail version. @@ -31,13 +32,10 @@ func PaintedString() string { name := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Name), color.FgYellow, color.BgBlue, color.AttrBold) - version := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Version), color.FgBlue, color.BgYellow, color.AttrBold) - protocol := color.PaintStr(fmt.Sprintf(" Protocol %s ", protocol.ProtocolCompat), color.FgBlack, color.BgGreen) - additional := color.PaintStrWithAttr(fmt.Sprintf(" %s ", Additional), color.FgWhite, color.BgMagenta, color.AttrUnderline) -- cgit v1.2.3