Skip to content

Commit 594ca5e

Browse files
committed
Only undefine Rails::Server#log_to_stdout if it's defined
I'm experiencing the following error when I run some Rake tasks that use `rails_semantic_logger`: ``` NameError: undefined method `log_to_stdout' for class `Rails::Server' ``` I don't quite understand how `log_to_stdout` could be undefined, but this fixes things for me, and seems to be a valid approach to the issue, so I thought I'd try to land it upstream, so I can upgrade from v4.6.1.
1 parent 840fcfa commit 594ca5e

File tree

1 file changed

+1
-1
lines changed
  • lib/rails_semantic_logger/extensions/rails

1 file changed

+1
-1
lines changed

lib/rails_semantic_logger/extensions/rails/server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Rails
55
class Server
66
private
77

8-
undef_method :log_to_stdout
8+
undef_method :log_to_stdout if Rails::Server.method_defined?(:log_to_stdout)
99
def log_to_stdout
1010
wrapped_app # touch the app so the logger is set up
1111

0 commit comments

Comments
 (0)