https://github.com/romshark/clog
Structured JSON logging pretty-printer
https://github.com/romshark/clog
Last synced: 3 months ago
JSON representation
Structured JSON logging pretty-printer
- Host: GitHub
- URL: https://github.com/romshark/clog
- Owner: romshark
- License: bsd-3-clause
- Created: 2022-08-07T18:20:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T14:07:13.000Z (8 months ago)
- Last Synced: 2025-02-01T15:22:01.339Z (8 months ago)
- Language: Go
- Size: 2.04 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clog - Cool Log 😎🪵
Pipe structured JSON logging outputs to Clog and let it pretty-print it for you 👨🏻🎨
Clog reads JSON logs from Stdin, parses and pretty-prints them according to the configuration. A configuration file can be provided with `-c`, the default config file path is `clog.toml`. If the config file isn't found then the defaults apply.
`clog -i` makes clog ignore OS interrupt signals, this can be useful to allow the process that pipes to clog and handles interrupt signals to exit gracefuly. If you run `clog -i` without piping anything to its input you can just press `CTRL+D` (EOF) and exit clog.
## Installation
```bash
go install -v github.com/romshark/clog@latest
```Also make sure `go/bin` is in your `PATH`.
## Example
`cat example.txt | clog`
## Styling
Supported style attributes:
```
bold
faint
italic
underline
blinkslow
blinkrapid
reversevideo
concealed
crossedout
fg-black
fg-red
fg-green
fg-yellow
fg-blue
fg-magenta
fg-cyan
fg-white
fg-hiblack
fg-hired
fg-higreen
fg-hiyellow
fg-hiblue
fg-himagenta
fg-hicyan
fg-hiwhite
bg-black
bg-red
bg-green
bg-yellow
bg-blue
bg-magenta
bg-cyan
bg-white
bg-hiblack
bg-hired
bg-higreen
bg-hiyellow
bg-hiblue
bg-himagenta
bg-hicyan
bg-hiwhite
```