class RubyChecker::Logger
Logger
handles logging by delegating the task:
-
If we are in Rails, use the default Rails logger.
-
If we are not in Rails, simply use the `puts` method.
Public Instance Methods
debug(msg)
click to toggle source
debug logs the given message as a debug message.
# File lib/ruby_checker/logger.rb, line 36 def debug(msg) if defined?(Rails) Rails.logger.tagged("ruby_checker") { Rails.logger.debug(msg) } else puts "[ruby_checker] Debug: #{msg}" end end
warn(msg)
click to toggle source
warn logs the given message as a warning.
# File lib/ruby_checker/logger.rb, line 27 def warn(msg) if defined?(Rails) Rails.logger.tagged("ruby_checker") { Rails.logger.warn(msg) } else puts "[ruby_checker] Warning: #{msg}" end end