module Fieldhand::Logger
A default null logger for discarding log messages.
Public Instance Methods
null()
click to toggle source
Return a new `Logger` that logs to the null device on this platform.
# File lib/fieldhand/logger.rb, line 12 def null ::Logger.new(null_device) end
null_device()
click to toggle source
Determine the null device on this platform, a backport of more recent Rubies' File::NULL See github.com/marcandre/backports/blob/v3.8.0/lib/backports/1.9.3/file/null.rb
# File lib/fieldhand/logger.rb, line 18 def null_device platform = ::RUBY_PLATFORM platform = ::RbConfig::CONFIG['host_os'] if platform == 'java' case platform when /mswin|mingw/i then 'NUL' when /amiga/i then 'NIL:' when /openvms/i then 'NL:' else '/dev/null' end end