Skip to content

cattlecloud/ulog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

ulog is a simple and efficient level logging library for Go

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •