Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewForTest ¶
func NewForTest(config *logger_config.Logs) (*zapLogger, *observer.ObservedLogs)
NewForTest returns a new logger and the corresponding observed logs which can be used in unit tests to verify log entries.
func NewTmpLogger ¶
func NewTmpLogger() *zapLogger
NewTmpLogger creates a temporary logger if the logger is not yet initialized.
func NewZapLogger ¶
func NewZapLogger(config *logger_config.Logs) *zapLogger
New creates a new logger using the default configuration.
func ResetGlobalLogger ¶
func ResetGlobalLogger()
ResetGlobalLogger resets the global logger for isolated tests.
Types ¶
type Logger ¶
type Logger interface { // With returns a logger based on the root logger and decorates it with the given context and arguments. With(ctx context.Context, args ...interface{}) Logger Debug(args ...interface{}) Info(args ...interface{}) Error(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Errorf(format string, args ...interface{}) }
Logger is a logger that supports log levels, context and structured logging.
func LogFactory ¶
func LogFactory(config *logger_config.Logs) (Logger, error)
Click to show internal directories.
Click to hide internal directories.