Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide( func(lc fx.Lifecycle, serviceName toolkitfx.ServiceName, config *Config) (*zap.Logger, error) { var ( logger *zap.Logger err error ) if config.Production { logger, err = NewProductionLogger(string(serviceName)) } else { logger, err = NewDevelopmentLogger(string(serviceName)) } if err != nil { return nil, err } zap.ReplaceGlobals(logger) lc.Append(fx.Hook{ OnStart: nil, OnStop: func(ctx context.Context) error { _ = logger.Sync() return nil }, }) return logger, nil }, ), )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.