Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.37 KB

File metadata and controls

46 lines (32 loc) · 1.37 KB

ulog

Go Reference License Build

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.

go get cattlecloud.net/go/ulog@latest

Examples

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.