Skip to content

Commit

Permalink
Add debug check to logp.Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
vjsamuel committed Aug 14, 2018
1 parent 8be58fe commit e6ed9d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
internal monitoring data. {issue}7807[7807]
- Allow for cloud-id to specify a custom port. This makes cloud-id work in ECE contexts. {pull}7887[7887]
- Add support to grow or shrink an existing spool file between restarts. {pull}7859[7859]
- Add debug check to logp.Logger {pull}7965[7965]

*Auditbeat*

Expand Down
6 changes: 6 additions & 0 deletions libbeat/logp/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package logp

import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)

// LogOption configures a Logger.
Expand Down Expand Up @@ -96,6 +97,11 @@ func (l *Logger) DPanic(args ...interface{}) {
l.sugar.DPanic(args...)
}

// IsDebug checks to see if the given logger is Debug enabled.
func (l *Logger) IsDebug() bool {
return l.sugar.Desugar().Check(zapcore.DebugLevel, "") != nil
}

// Sprintf

// Debugf uses fmt.Sprintf to construct and log a message.
Expand Down

0 comments on commit e6ed9d5

Please sign in to comment.