Sha256: 2f32965ca7217ae684a4d07a318a3fa8d2dc07a940ff8f631f9fd5a97cb6d250

Contents?: true

Size: 586 Bytes

Versions: 13

Compression:

Stored size: 586 Bytes

Contents

require 'logger'

module DAV4Rack
  # This is a simple wrapper for the Logger class. It allows easy access 
  # to log messages from the library.
  class Logger
    class << self
      # args:: Arguments for Logger -> [path, level] (level is optional)
      # Set the path to the log file.
      def set(*args)
        @@logger = ::Logger.new(args.first, 'weekly')
        if(args.size > 1)
          @@logger.level = args[1]
        end
      end
      
      def method_missing(*args)
        if(defined? @@logger)
          @@logger.send *args
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dav4rack-0.2.4 lib/dav4rack/logger.rb
dav4rack-0.2.3 lib/dav4rack/logger.rb
dav4rack-0.2.2 lib/dav4rack/logger.rb
dav4rack-0.2.1 lib/dav4rack/logger.rb
dav4rack-0.2.0 lib/dav4rack/logger.rb
dav4rack-0.1.8 lib/dav4rack/logger.rb
dav4rack-0.1.7 lib/dav4rack/logger.rb
dav4rack-0.1.6 lib/dav4rack/logger.rb
dav4rack-0.1.5 lib/dav4rack/logger.rb
dav4rack-0.1.4 lib/dav4rack/logger.rb
dav4rack-0.1.3 lib/dav4rack/logger.rb
dav4rack-0.1.2 lib/dav4rack/logger.rb
dav4rack-0.1.1 lib/dav4rack/logger.rb