lib/bitcoin/logger.rb in bitcoin-ruby-0.0.6 vs lib/bitcoin/logger.rb in bitcoin-ruby-0.0.7
- old
+ new
@@ -1,18 +1,9 @@
# encoding: ascii-8bit
-if Bitcoin.require_dependency :log4r, exit: false
- # monkey-patch Log4r to accept level names as symbols
- class Log4r::Logger
- def level= l = 0
- _level = l.is_a?(Fixnum) ? l : Log4r::LNAMES.index(l.to_s.upcase)
- Log4r::Log4rTools.validate_level(_level)
- @level = _level
- LoggerFactory.define_methods(self)
- Log4r::Logger.log_internal {"Logger '#{@fullname}' set to #{LNAMES[@level]}"}
- @level
- end
- end
+begin
+ require 'log4r'
+rescue LoadError
end
module Bitcoin
# this is a very simple logger that is used if log4r is not available
module Logger