prettylog

command
v0.0.0-...-c0db0da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 8 Imported by: 0

README

Zerolog PrettyLog

This is a basic CLI utility that will colorize and pretty print your structured JSON logs.

Usage

You can compile it or run it directly. The only issue is that by default Zerolog does not output to stdout but rather to stderr so we must pipe stderr stream to this CLI tool.

Linux

These commands will redirect stderr to our prettylog tool and stdout will remain unaffected.

  1. Compiled version
some_program_with_zerolog 2> >(prettylog)
  1. Run it directly with go run
some_program_with_zerolog 2> >(go run cmd/prettylog/prettylog.go)
Windows

These commands will redirect stderr to stdout and then pipe it to our prettylog tool.

  1. Compiled version
some_program_with_zerolog 2>&1 | prettylog
  1. Run it directly with go run
some_program_with_zerolog 2>&1 | go run cmd/prettylog/prettylog.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL