From 8462b57c1b52f27cab9db660dd7b66b082d4f39b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Wed, 1 May 2024 17:34:49 +1200 Subject: [PATCH] Don't log failures if error logging is not enabled. --- lib/console/logger.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/console/logger.rb b/lib/console/logger.rb index 95f43eb..ecb709f 100644 --- a/lib/console/logger.rb +++ b/lib/console/logger.rb @@ -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