Something went wrong. Try again.
Something went wrong. Try again.
Files
Verified signature Signed by followtheprocess.codes SHA256:pCoEQ407vbQvubn3xfx3h3cxwbHZT+xG5IBdQ/ZA+zY Click to copy SHA
Verified signature Signed by followtheprocess.codes SHA256:pCoEQ407vbQvubn3xfx3h3cxwbHZT+xG5IBdQ/ZA+zY Click to copy SHA
- Go 93%
- Nix 7%
README.md
# log
[](https://github.com/FollowTheProcess/log)
[](https://pkg.go.dev/go.followtheprocess.codes/log)
[](https://github.com/FollowTheProcess/log)
[](https://github.com/FollowTheProcess/log/actions?query=workflow%3ACI)
[](https://codecov.io/gh/FollowTheProcess/log)
Simple, fast, opinionated logging for command line applications 🪵
<p align="center">
<img src="https://assets.followtheprocess.codes/projects/log/demo.gif" alt="demo">
</p>
## Project Description
`log` is a tiny and incredibly simple logging library designed to output nicely presented, human readable, levelled log messages. Ideal for command line applications ✨
There are many great logging libraries for Go out there, but so many of them are IMO too flexible and too complicated. I wanted a small, minimal dependency, opinionated logger I could
use everywhere across all my Go projects (which are mostly command line applications). So I made one 🚀
## Installation
```bash
go get go.followtheprocess.codes/log@latest
```
## Quickstart
```go
package main
import (
"fmt"
"os"
"log/slog"
"go.followtheprocess.codes/log"
)
func main() {
logger := log.New(os.Stderr)
logger.Debug("Debug me") // By default this one won't show up, default log level is INFO
logger.Info(
"Some information here",
// Yep! You use slog.Attrs for key value pairs, why reinvent the wheel?
// ... says the guy who wrote a new Logger
slog.Bool("really", true),
)
logger.Warn("Uh oh!")
logger.Error("Goodbye")
}
```
## Usage Guide
Make a new logger
```go
logger := log.New(os.Stderr)
```
### Levels
`log` provides a levelled logger wit…