Skip to content

Commit

Permalink
Merge pull request #18 from fortio/color_v3
Browse files Browse the repository at this point in the history
Use the new [LVL] from log 1.9.3
  • Loading branch information
ldemailly authored Aug 3, 2023
2 parents fe7debf + 0d629e4 commit b1857c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Binary file modified example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module fortio.org/logc
go 1.18

require (
fortio.org/cli v1.3.1
fortio.org/log v1.9.2
fortio.org/scli v1.10.1
fortio.org/cli v1.3.2
fortio.org/log v1.9.3
fortio.org/scli v1.10.3
)

require (
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fortio.org/assert v1.1.4 h1:Za1RaG+OjsTMpQS3J3UCvTF6wc4+IOHCz+jAOU37Y4o=
fortio.org/cli v1.3.1 h1:ExJyciUTLLY1gznExrthduDyw0jKKP95UKrMGfh+n+8=
fortio.org/cli v1.3.1/go.mod h1:R4+pCDYD+40fvomN0yg+CZmU6gkA1PrsunR2hy0dfts=
fortio.org/cli v1.3.2 h1:6y7AXmNs3RymsPmm3VxfGodF/oTDouONlwXRHuFhRhM=
fortio.org/cli v1.3.2/go.mod h1:ZsevXTvMidh3xllYoAElS52XRcGx+f1hVlgB+v2Pa0Y=
fortio.org/dflag v1.5.2 h1:F9XVRj4Qr2IbJP7BMj7XZc9wB0Q/RZ61Ool+4YPVad8=
fortio.org/dflag v1.5.2/go.mod h1:ppb/A8u+KKg+qUUYZNYuvRnXuVb8IsdHb/XGzsmjkN8=
fortio.org/log v1.9.2 h1:rVCzSFhTD+lsdGUhVuTWoqdFjJP+XD3da9p09pwPohY=
fortio.org/log v1.9.2/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/scli v1.10.1 h1:jJVvPcK9RO2OOKc2CzxwLavJsvXxr1DwCU6VH3efCy8=
fortio.org/scli v1.10.1/go.mod h1:A7ASXPbm6DDhtuPZV6pAiNfAwcUchABy41ndZk8AID0=
fortio.org/log v1.9.3 h1:rkgDmgF7dLfNRtVOE44Av5KBlro8FkpTKnTnphHy074=
fortio.org/log v1.9.3/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU=
fortio.org/scli v1.10.3 h1:6aNn9ggOAoyp9vDs3rXN3uMZiRHcVdlPbsTHoN8PfiE=
fortio.org/scli v1.10.3/go.mod h1:qfmKaJUtGumrCs0+CfErIFp2qjT2OV6BTBGXGgRqaY4=
fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4=
fortio.org/sets v1.0.3/go.mod h1:QZVj0r6KP/ZD9ebySW9SgxVNy/NjghUfyHW9NN+WU+4=
fortio.org/version v1.0.2 h1:8NwxdX58aoeKx7T5xAPO0xlUu1Hpk42nRz5s6e6eKZ0=
Expand Down
4 changes: 3 additions & 1 deletion logc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ func TestLevels(t *testing.T) {
var zeroTime time.Time
log.Config.ForceColor = true
log.SetColorMode()
left := log.Colors.DarkGray + "["
right := log.Colors.DarkGray + "]"
for _, tc := range []struct {
in string
want string
}{
{`{"level":"trace","msg":"foo"}`, log.Colors.Cyan + "Verb" + log.Colors.DarkGray + "> " +
{`{"level":"trace","msg":"foo"}`, left + log.Colors.Cyan + "VRB" + right + "> " +
log.Colors.Cyan + "foo" + log.Colors.Reset + "\n"},
{`{"level":"xyz","msg":"foo"}`, log.Colors.BrightRed + "?> " + log.Colors.Blue + "foo" + log.Colors.Reset + "\n"},
} {
Expand Down

0 comments on commit b1857c1

Please sign in to comment.