summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-07-30 08:51:05 +0300
committerPaul Buetow <paul@buetow.org>2021-07-30 08:51:05 +0300
commit4ebff5064251d24c7d80873074c9a614311b027d (patch)
tree14bd4bfcefbec10346e250e93ee5e35afd2cbb6f
parent6408c5cdd3e5d79ae42201b43f133ad75c281aad (diff)
initial color config support
-rw-r--r--internal/color/color.go3
-rw-r--r--internal/config/client.go17
2 files changed, 18 insertions, 2 deletions
diff --git a/internal/color/color.go b/internal/color/color.go
index 0736199..7309544 100644
--- a/internal/color/color.go
+++ b/internal/color/color.go
@@ -26,8 +26,7 @@ const (
Yellow Color = escape + "[36m"
LightGray Color = escape + "[37m"
- BgGray Color = escape + "[40m"
- BgRed Color = escape + "[41m"
+ BgGray Color = escape + "[40m" BgRed Color = escape + "[41m"
BgGreen Color = escape + "[42m"
BgOrange Color = escape + "[43m"
BgBlue Color = escape + "[44m"
diff --git a/internal/config/client.go b/internal/config/client.go
index 1515aae..3d8c45a 100644
--- a/internal/config/client.go
+++ b/internal/config/client.go
@@ -1,8 +1,25 @@
package config
+// ClientColorConfig allows to override the default terminal color codes.
+type ClientColorConfig struct {
+ OkBgColor Color
+}
+
+/*
+ splitted := strings.Split(line, "|")
+ if splitted[2] == "100" {
+ splitted[2] = Paint(BgGreen, splitted[2])
+ } else {
+ splitted[2] = Paint(BgRed, splitted[2])
+ }
+ info := strings.Join(splitted[0:5], "|")
+ log := strings.Join(splitted[5:], "|")
+*/
+
// ClientConfig represents a DTail client configuration (empty as of now as there
// are no available config options yet, but that may changes in the future).
type ClientConfig struct {
+ TerminalColors ClientColorConfig `json:",omitempty"`
}
// Create a new default client configuration.