https://github.com/coder/flog
Pretty formatted log for Go
https://github.com/coder/flog
Last synced: 15 days ago
JSON representation
Pretty formatted log for Go
- Host: GitHub
- URL: https://github.com/coder/flog
- Owner: coder
- License: mit
- Created: 2018-12-21T22:01:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-12T17:46:48.000Z (about 2 years ago)
- Last Synced: 2025-04-02T12:39:53.620Z (23 days ago)
- Language: Go
- Size: 79.1 KB
- Stars: 24
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flog
`flog` is a minimal, formatted, pretty logging package for Go.
It's optimized for human readability and CLIs.
* Log levels color-code the timestamp
* Log level doesn't change the width of the prefix[slog](https://github.com/cdr/slog) is recommended for robust logging.
[](https://godoc.org/github.com/coder/flog)
## Install
`go get github.com/coder/flog`
## Usage
```go
flog.Infof("hello %.3f", 1/3.0)
flog.Successf("finished that")
flog.Errorf("oops")log := flog.New(os.Stderr).WithPrefix("user %v: ", 500)
log.Errorf("didn't work out")
```## Output
