Skip to content

Commit

Permalink
v0.9.19
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangyt committed Oct 23, 2020
1 parent c0518b0 commit c5aca68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Structured log, AKA. JSON line log, is great for log collectors but hard to read
- [ ] Straightforward filtering:
- [x] by logger level
- [x] by absolute time range
- [ ] by relative time range
- [x] by relative time range

- [x] Support JSON log mixed with non-JSON text, includes:
- [x] Mixed with regular flat log lines, for ex., springboot banner, and PM2 banner
Expand All @@ -49,7 +49,7 @@ Structured log, AKA. JSON line log, is great for log collectors but hard to read
Download the executable binary (https://github.com/qiangyt/jog/releases/) to $PATH. For ex., for Mac OSX and Linux,

```shell
sudo curl -L https://github.com/qiangyt/jog/releases/download/v0.9.18/jog.$(echo `uname -s` | tr A-Z a-z) -o /usr/local/bin/jog
sudo curl -L https://github.com/qiangyt/jog/releases/download/v0.9.19/jog.$(echo `uname -s` | tr A-Z a-z) -o /usr/local/bin/jog
sudo chmod +x /usr/local/bin/jog
```

Expand All @@ -75,13 +75,14 @@ Structured log, AKA. JSON line log, is great for log collectors but hard to read
5) print the default template: jog -t
6) only shows WARN & ERROR level: jog -l warn -l error app-20200701-1.log
7) shows with timestamp range: jog --after 2020-7-1 --before 2020-7-3 app-20200701-1.log
8) with WARN level foreground color set to RED: jog -cs fields.level.enums.WARN.color=FgRed app-20200701-1.log
9) view the WARN level config item: jog -cg fields.level.enums.WARN
10) disable colorization: jog -cs colorization=false app-20200701-1.log
8) natural timestamp range: jog --after "1 week" --before "2 days" app-20200701-1.log
9) with WARN level foreground color set to RED: jog -cs fields.level.enums.WARN.color=FgRed app-20200701-1.log
10) view the WARN level config item: jog -cg fields.level.enums.WARN
11) disable colorization: jog -cs colorization=false app-20200701-1.log
Options:
-a, --after <timestamp> 'after' time filter. Auto-detect the timestamp format
-b, --before <timestamp> 'before' time filter. Auto-detect the timestamp format
-a, --after <timestamp> 'after' time filter. Auto-detect the timestamp format; can be natural datetime
-b, --before <timestamp> 'before' time filter. Auto-detect the timestamp format; can be natural datetime
-c, --config <config file path> Specify config YAML file path. The default is .jog.yaml or $HOME/.jog.yaml
-cs, --config-set <config item path>=<config item value> Set value to specified config item
-cg, --config-get <config item path> Get value to specified config item
Expand Down
13 changes: 7 additions & 6 deletions cmdline.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

const (
// AppVersion ...
AppVersion = "v0.9.18"
AppVersion = "v0.9.19"
)

// PrintVersion ...
Expand Down Expand Up @@ -42,14 +42,15 @@ func PrintHelp() {
fmt.Println(" 5) print the default template: jog -t")
fmt.Println(" 6) only shows WARN & ERROR level: jog -l warn -l error app-20200701-1.log")
fmt.Println(" 7) shows with timestamp range: jog --after 2020-7-1 --before 2020-7-3 app-20200701-1.log")
fmt.Println(" 8) with WARN level foreground color set to RED: jog -cs fields.level.enums.WARN.color=FgRed app-20200701-1.log")
fmt.Println(" 9) view the WARN level config item: jog -cg fields.level.enums.WARN")
fmt.Println(" 10) disable colorization: jog -cs colorization=false app-20200701-1.log")
fmt.Println(" 8) natural timestamp range: jog --after \"1 week\" --before \"2 days\" app-20200701-1.log")
fmt.Println(" 9) with WARN level foreground color set to RED: jog -cs fields.level.enums.WARN.color=FgRed app-20200701-1.log")
fmt.Println(" 10) view the WARN level config item: jog -cg fields.level.enums.WARN")
fmt.Println(" 11) disable colorization: jog -cs colorization=false app-20200701-1.log")
fmt.Println()

color.New(color.FgBlue, color.OpBold).Println("Options:")
fmt.Printf(" -a, --after <timestamp> 'after' time filter. Auto-detect the timestamp format \n")
fmt.Printf(" -b, --before <timestamp> 'before' time filter. Auto-detect the timestamp format \n")
fmt.Printf(" -a, --after <timestamp> 'after' time filter. Auto-detect the timestamp format; can be natural datetime \n")
fmt.Printf(" -b, --before <timestamp> 'before' time filter. Auto-detect the timestamp format; can be natural datetime \n")
fmt.Printf(" -c, --config <config file path> Specify config YAML file path. The default is .jog.yaml or $HOME/.jog.yaml \n")
fmt.Printf(" -cs, --config-set <config item path>=<config item value> Set value to specified config item \n")
fmt.Printf(" -cg, --config-get <config item path> Get value to specified config item \n")
Expand Down

0 comments on commit c5aca68

Please sign in to comment.