diff --git a/README.md b/README.md index a5feeb3a..b7715800 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,22 @@ Read logs from `stdin` and prints them back to `stdout`, but prettier. # Using it -[Grab a release](https://github.com/humanlogio/humanlog/releases) or : - -## With Go installed +## On macOS ```bash -$ go install github.com/humanlogio/humanlog/cmd/humanlog@latest +brew tap humanlogio/homebrew-tap +brew install humanlog ``` -## On linux +## On linux (and macOS) ```bash -wget -qO- https://github.com/humanlogio/humanlog/releases/download/v0.6.2/humanlog_v0.6.2_linux_amd64.tar.gz | tar xvz +curl -L "https://humanlog.io/install.sh" | sh ``` -## On OS X +## Otherwise -```bash -brew tap humanlogio/homebrew-tap -brew install humanlog -``` +[Grab a release](https://github.com/humanlogio/humanlog/releases)! # Example @@ -36,15 +32,6 @@ $ humanlog < /var/log/logfile.log ![2__fish___users_antoine_gocode_src_github_com_humanlogio_humanlog__fish_](https://cloud.githubusercontent.com/assets/1189716/4328545/f2330bb4-3f86-11e4-8242-4f49f6ae9efc.png) -# Contributing - -How to help: - -- **support more log formats**: by submitting `human.Handler` implementations. -- **live querying**: add support for filtering in log output in real time. -- **charting**: some key-values have semantics that could be charted in real time. For - instance, durations, frequency of numeric values, etc. See the [l2met][] project. - # Usage ``` @@ -61,6 +48,7 @@ AUTHOR: Antoine Grondin COMMANDS: + version Interact with humanlog versions help, h Shows a list of commands or help for one command GLOBAL OPTIONS: diff --git a/cmd/humanlog/versions.go b/cmd/humanlog/versions.go index f515537e..4d228d0a 100644 --- a/cmd/humanlog/versions.go +++ b/cmd/humanlog/versions.go @@ -2,6 +2,7 @@ package main import ( "context" + "errors" "fmt" "log" "net/http" @@ -96,10 +97,12 @@ func versionCmd( getState func(cctx *cli.Context) *state.State, ) cli.Command { return cli.Command{ - Name: versionCmdName, + Name: versionCmdName, + Usage: "Interact with humanlog versions", Subcommands: cli.Commands{ { - Name: "check", + Name: "check", + Usage: "checks whether a newer version is available", Action: func(cctx *cli.Context) error { ctx := getCtx(cctx) cfg := getCfg(cctx) @@ -124,7 +127,8 @@ func versionCmd( }, }, { - Name: "update", + Name: "update", + Usage: "self-update to the latest version", Action: func(cctx *cli.Context) error { ctx := getCtx(cctx) cfg := getCfg(cctx) @@ -194,8 +198,11 @@ func asyncCheckForUpdate(ctx context.Context, req *checkForUpdateReq, cfg *confi defer close(out) nextVersion, _, hasUpdate, err := checkForUpdate(ctx, cfg, state) if err != nil { - // TODO: log to diagnostic file - log.Printf("failed to check for update") + if errors.Is(errors.Unwrap(err), context.Canceled) { + return + } + // TODO: log to diagnostic file? + log.Printf("failed to check for update: %v", err) return } nexVersion, err := nextVersion.AsSemver()