Skip to content

Commit 7cd201e

Browse files
author
Petr Chalupa
committed
Merge pull request #160 from ruby-concurrency/actress
Do not fail when there is an error in logger callback
2 parents c147fb0 + 41530e2 commit 7cd201e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/concurrent/logging.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ module Logging
1212
# @yieldreturn [String] a message
1313
def log(level, progname, message = nil, &block)
1414
(@logger || Concurrent.configuration.logger).call level, progname, message, &block
15+
rescue => error
16+
$stderr.puts "`Concurrent.configuration.logger` failed to log #{[level, progname, message, block]}\n" +
17+
"#{error.message} (#{error.class})\n#{error.backtrace.join "\n"}"
1518
end
1619
end
1720
end

0 commit comments

Comments
 (0)