Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (l *Loader) Load(files []string) (*Config, error) {
return nil, fmt.Errorf("cannot get configuration from '%s': %w", f, err)
}
inputsList = append(inputsList, inp...)
l.logger.Debugf("Loaded %s input(s) from configuration from %s", len(inp), f)
l.logger.Debugf("Loaded %d input(s) from configuration from %s", len(inp), f)
} else {
if err := merger.Add(cfg.access(), err); err != nil {
return nil, fmt.Errorf("failed to merge configuration file '%s' to existing one: %w", f, err)
Expand Down
24 changes: 21 additions & 3 deletions logp/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ func NewDevelopmentLogger(selector string, options ...LogOption) (*Logger, error
return nil, err
}
logger = logger.Named(selector)
if err != nil {
return nil, err
}
return &Logger{logger, logger.Sugar(), make(map[string]struct{})}, nil
}

Expand Down Expand Up @@ -224,37 +221,58 @@ func (l *Logger) IsDebug() bool {

// Debugf uses fmt.Sprintf to construct and log a message.
func (l *Logger) Debugf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Debugf(format, args...)
}

// Infof uses fmt.Sprintf to log a templated message.
func (l *Logger) Infof(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Infof(format, args...)
}

// Warnf uses fmt.Sprintf to log a templated message.
func (l *Logger) Warnf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Warnf(format, args...)
}

// Errorf uses fmt.Sprintf to log a templated message.
func (l *Logger) Errorf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Errorf(format, args...)
}

// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit(1).
func (l *Logger) Fatalf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Fatalf(format, args...)
}

// Panicf uses fmt.Sprintf to log a templated message, then panics.
func (l *Logger) Panicf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.Panicf(format, args...)
}

// DPanicf uses fmt.Sprintf to log a templated message. In development, the
// logger then panics.
func (l *Logger) DPanicf(format string, args ...interface{}) {
if false {
_ = fmt.Sprintf(format, args...) // enable printf checking
}
l.sugar.DPanicf(format, args...)
}

Expand Down
Loading