Sha256: 2c834134bb5b6f5e158f4944e482a3d4ac69e009be1ea935cfeb9fb55f8fed4c

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

require 'logger'

module Docx
    class Logger < ::Logger
        def initialize(*args, **kwargs)
            super
            @formatter = SimpleFormatter.new
            @level = ENV['LOG_LEVEL'].to_i if ENV.keys.include?('LOG_LEVEL')
        end

        # Simple formatter which only displays the message
        class SimpleFormatter < ::Logger::Formatter
            # This method is invoked when a log event occurs
            def call(severity, timestamp, progname, msg)
                "#{String === msg ? msg : msg.inspect}\n"
            end
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
docx-builder-0.2.3 lib/docx/logger.rb