Sha256: 8f44f9805dd319b776028c44bd25595e602fd89bb1591c9f59da2e4c953e3ef7

Contents?: true

Size: 530 Bytes

Versions: 46

Compression:

Stored size: 530 Bytes

Contents

module SiteHook
  module Loggers
    class Access
      def initialize(base: 'ACCESS')
        @@loggers = {
            stdout: ::Logger.new(STDOUT, progname: base),
            file: ::Logger.new(SiteHook::Paths.make_log_name(base), progname: base)
        }
      end
      # @param [Symbol] level log level to log at
      # @param [Object] obj some kind of object or msg to log
      def log(obj)
        @@loggers.each do |_type, logger|

          logger.<< "[#{Time.now}] #{obj}\n"
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
site_hook-0.9.8 lib/site_hook/loggers/access.rb
site_hook-0.9.7 lib/site_hook/loggers/access.rb
site_hook-0.9.6 lib/site_hook/loggers/access.rb
site_hook-0.9.5 lib/site_hook/loggers/access.rb
site_hook-0.9.4 lib/site_hook/loggers/access.rb
site_hook-0.9.3 lib/site_hook/loggers/access.rb