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-1.0.30 lib/site_hook/loggers/access.rb
site_hook-1.0.29 lib/site_hook/loggers/access.rb
site_hook-1.0.28 lib/site_hook/loggers/access.rb
site_hook-1.0.27 lib/site_hook/loggers/access.rb
site_hook-1.0.26 lib/site_hook/loggers/access.rb
site_hook-1.0.25 lib/site_hook/loggers/access.rb
site_hook-1.0.24 lib/site_hook/loggers/access.rb
site_hook-1.0.23 lib/site_hook/loggers/access.rb
site_hook-1.0.22 lib/site_hook/loggers/access.rb
site_hook-1.0.21 lib/site_hook/loggers/access.rb
site_hook-1.0.20 lib/site_hook/loggers/access.rb
site_hook-1.0.19 lib/site_hook/loggers/access.rb
site_hook-1.0.18 lib/site_hook/loggers/access.rb
site_hook-1.0.17 lib/site_hook/loggers/access.rb
site_hook-1.0.16 lib/site_hook/loggers/access.rb
site_hook-1.0.15 lib/site_hook/loggers/access.rb
site_hook-1.0.14 lib/site_hook/loggers/access.rb
site_hook-1.0.13 lib/site_hook/loggers/access.rb
site_hook-1.0.12 lib/site_hook/loggers/access.rb
site_hook-1.0.11 lib/site_hook/loggers/access.rb