diff --git a/internal/component/loki/process/stages/regex.go b/internal/component/loki/process/stages/regex.go index f734545ac..42625f2ce 100644 --- a/internal/component/loki/process/stages/regex.go +++ b/internal/component/loki/process/stages/regex.go @@ -112,7 +112,7 @@ func (r *regexStage) Process(labels model.LabelSet, extracted map[string]interfa extracted[name] = match[i] } } - if isDebugEnabled(r.logger) { + if Debug { level.Debug(r.logger).Log("msg", "extracted data debug in regex stage", "extracted data", fmt.Sprintf("%v", extracted)) } } @@ -121,7 +121,3 @@ func (r *regexStage) Process(labels model.LabelSet, extracted map[string]interfa func (r *regexStage) Name() string { return StageTypeRegex } - -func isDebugEnabled(logger log.Logger) bool { - return level.AllowDebug().Enabled(logger) -}