https://github.com/cattlecloud/ulog
ulog is a simple and efficient level logging library for Go
https://github.com/cattlecloud/ulog
efficient go golang leveled log logging simple
Last synced: about 1 month ago
JSON representation
ulog is a simple and efficient level logging library for Go
- Host: GitHub
- URL: https://github.com/cattlecloud/ulog
- Owner: cattlecloud
- License: bsd-3-clause
- Created: 2023-12-13T20:18:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-01T10:27:06.000Z (4 months ago)
- Last Synced: 2025-12-03T22:15:51.579Z (4 months ago)
- Topics: efficient, go, golang, leveled, log, logging, simple
- Language: Go
- Homepage: https://cattlecloud.net/go/ulog
- Size: 24.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ulog
[](https://pkg.go.dev/cattlecloud.net/go/ulog)
[](https://github.com/cattlecloud/ulog/blob/main/LICENSE)
[](https://github.com/cattlecloud/ulog/actions/workflows/ci.yaml)
`ulog` is a simple and efficient level logging library for Go
### Getting Started
The `ulog` package can be added to a project with `go get`.
```shell
go get cattlecloud.net/go/ulog@latest
```
### Examples
```go
log := ulog.New("my/component")
log.E.Fmt("the level is %s", "error")
log.W.Fmt("the level is %s", "warn")
log.I.Fmt("the level is %s", "info")
log.D.Fmt("the level is %s", "debug")
log.T.Fmt("the level is %s", "trace")
```
### Exclude timestamp
When running under systemd it is nice to not include the redundant timestamp
directly from the logging package (since journald will already insert one). To
exclude the timestamp simply set the `ULOG_NOTIMESTAMP` environment variable
to `true`.
e.g. in a systemd unit file
```
[Service]
# ...
Environment="ULOG_NOTIMESTAMP=true"
```
### License
The `cattlecloud.net/go/ulog` module is open source under the [BSD-3-Clause](LICENSE) license.