Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
G = Get
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is the logger configuration
func AddFlags ¶
AddFlags binds the logger configuration flags to the provided flag set and returns a config object that can return a configured logger by calling the Build() function.
func PersistentSetup ¶ added in v0.0.6
PersistentSetup set up the logger on the root command, adding the required flags and calling Build() in the command PreRunE function.
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
func Build ¶
Build builds a new logger from a config. If conf is nil, uses default configuration. This will set the root logger which is returned from G(). If you do not want to set the root logger you should use conf.Build() instead.
func Get ¶
func Get() *Logger
Get returns the default configured logger. You may also use its shorter alias: @G()
func (*Logger) NewMiddleware ¶
func (l *Logger) NewMiddleware(next http.HandlerFunc) http.HandlerFunc
NewMiddleware returns an http middleware that logs requests