Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme authored and Antoine Grondin committed Jan 14, 2023
1 parent 92bf8cd commit a387dd3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

```
Expand All @@ -61,6 +48,7 @@ AUTHOR:
Antoine Grondin <[email protected]>
COMMANDS:
version Interact with humanlog versions
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
Expand Down
17 changes: 12 additions & 5 deletions cmd/humanlog/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"errors"
"fmt"
"log"
"net/http"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a387dd3

Please sign in to comment.