{"repo":"go-pkgz/lgr","free":true,"listed":false,"github":"https://github.com/go-pkgz/lgr","clone":"git clone https://github.com/go-pkgz/lgr.git","description":"Basic logger with some extras","language":"Go","stars":67,"topics":["golang","go","logger","logging"],"license":"MIT","category":"analytics","readme_excerpt":"lgr - simple logger with some extras install go get github.com/go-pkgz/lgr usage output looks like this: Without lgr.Caller it will drop {caller} part details interfaces and default loggers - lgr package provides a single interface lgr.L with a single method Logf(format string, args ...interface{}) . Function wrapper lgr.Func allows making lgr.L from a function directly. - Default logger functionality can be used without lgr.New (see \"global logger\") - Two predefined loggers available: lgr.NoOp (do-nothing logger) and lgr.Std (passing directly to stdlib log) options lgr.New call accepts functional options: - lgr.Debug - turn debug mode on to allow messages with \"DEBUG\" level (filtered otherwise) - lgr.Trace - turn trace mode on to allow messages with \"TRACE\" abd \"DEBUG\" levels both (filtered otherwise) - lgr.Out(io.Writer) - sets the output writer, default os.Stdout - lgr.Err(io.Writer) - sets the error writer, default os.Stderr - lgr.CallerFile - adds the caller file info (only affects lgr's native text format, not slog output) - lgr.CallerFunc - adds the caller function info (only affects lgr's native text format, not slog output) - lgr.CallerPkg - adds the caller package (only affects lgr's native text format, not slog output) - lgr.LevelBraces - wraps levels with \"[\" and \"]\" - lgr.Msec - adds milliseconds to timestamp - lgr.Format - sets a custom template, overwrite all other formatting modifiers. - lgr.Secret(secret ...) - sets list of the secrets to hide from the loggin","default_branch":null,"files":null,"tree":[],"storefront":"/r/go-pkgz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/go-pkgz/lgr/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}