Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : gitlab.com/rumpelsepp/logging

Package logging provides a partial reimplementation of the log package in the standard library. This package provides simple logging with loglevels and an interface quite similar to the standard library. There are two environment variables supported: GOLOGGING_LOGLEVEL In addition to the SetLogLevel() methods, the loglevel can be set globally via an environment variable. The recognized values are: ERROR, WARN, INFO, DEBUG, and TRACE. GOLOGGING_MODULES An optional module string can be set for each logger. This environment variable enables filtering on a module basis. A comma seperated list of strings is accepted. If GOLOGGING_MODULES is set to e.g. "dial,listen", only loggers with the module set to "dial", or "listen" emit output. If you need more sophisticated filtering, this can be done outside of your program using e.g. syslogd(8) or systemd-journald(8). For your convenience, there is a package level logger available, which can be accessed using the relevant methods. The package level logger is there for programs that do not need several loggers. It aims to simplify this particular usecase. If you need several loggers, please instantiate them as needed and do not use the package level logger. Timestamps are not supported by design, since this is almost always not needed. On the terminal, you can pipe the output through ts(1) from moreutils. Using a logging service, the timestamps are already handled perfectly. This avoids the annoying problem of doubled timestamps in the log database, such as: Aug 10 07:24:37 host service[pid]: TIMESTAMP MESSAGE.

Registry - Source - Documentation - JSON
purl: pkg:golang/gitlab.com/rumpelsepp/logging
Keywords: golang, logging, loglevel, simple
License: MIT
Latest release: over 5 years ago
First release: over 5 years ago
Namespace: gitlab.com/rumpelsepp
Stars: 0 on GitLab.com
Forks: 0 on GitLab.com
See more repository details: repos.ecosyste.ms
Last synced: 20 days ago

    Loading...
    Readme
    Loading...