Skip to content

Commit 41530e2

Browse files
committed
fix #159 do not fail when there is an error in logger callback
1 parent c147fb0 commit 41530e2

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)