Sha256: e2ddb7516e195b1aff7044708450cbfbebac37ce1e0b4c37df5f4ce797b381d9

Contents?: true

Size: 694 Bytes

Versions: 25

Compression:

Stored size: 694 Bytes

Contents

module Napa
  class Logger
    class << self
      def name
        [Napa::Identity.name, Napa::LogTransaction.id].join('-')
      end

      def logger=(logger)
        @logger = logger
      end

      def logger
        unless @logger
          Logging.appenders.stdout(
            'stdout',
            layout: Logging.layouts.json
          )
          Logging.appenders.file(
            "log/#{Napa.env}.log",
            layout: Logging.layouts.json
          )

          @logger = Logging.logger["[#{name}]"]
          @logger.add_appenders 'stdout' unless Napa.env.test?
          @logger.add_appenders "log/#{Napa.env}.log"
        end

        @logger
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
napa-0.2.1 lib/napa/logger/logger.rb
napa-0.2.0 lib/napa/logger/logger.rb
napa-0.1.29 lib/napa/logger/logger.rb
napa-0.1.28 lib/napa/logger/logger.rb
napa-0.1.26 lib/napa/logger/logger.rb
napa-0.1.25 lib/napa/logger/logger.rb
napa-0.1.24 lib/napa/logger/logger.rb
napa-0.1.23 lib/napa/logger/logger.rb
napa-0.1.22 lib/napa/logger/logger.rb
napa-0.1.21 lib/napa/logger/logger.rb
napa-0.1.20 lib/napa/logger/logger.rb
napa-0.1.19 lib/napa/logger/logger.rb
napa-0.1.18 lib/napa/logger/logger.rb
napa-0.1.17 lib/napa/logger/logger.rb
napa-0.1.16 lib/napa/logger/logger.rb
napa-0.1.15 lib/napa/logger/logger.rb
napa-0.1.14 lib/napa/logger/logger.rb
napa-0.1.12 lib/napa/logger/logger.rb
napa-0.1.13 lib/napa/logger/logger.rb
napa-0.1.11 lib/napa/logger/logger.rb