Skip to content

Commit

Permalink
Don't log failures if error logging is not enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 1, 2024
1 parent 12b5c34 commit 8462b57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/console/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def error(subject, *arguments, **options, &block)
end

def failure(subject, exception, *arguments, **options, &block)
self.error(subject, *arguments, **options, **Event::Failure.for(exception), &block)
if self.enabled?(subject, ERROR)
self.call(subject, *arguments, severity: :error, **options, **Event::Failure.for(exception), &block)
end
end
end
end

0 comments on commit 8462b57

Please sign in to comment.