Sha256: 2e7a30bb5979bd34418d2fd9a67ab3f3120e1f0d42b35889da42ef64d547d2c7
Contents?: true
Size: 707 Bytes
Versions: 1
Compression:
Stored size: 707 Bytes
Contents
# frozen_string_literal: true module ErpIntegration # The Logger class is a simple wrapper around the logger object. class Logger delegate :debug, :info, :warn, :error, :fatal, to: :logger, allow_nil: true def initialize(logger = nil) @logger = logger end # Logs the given tags if the logger is present. # If the logger does not respond to `tagged`, it logs the tags as an info message. def with_tags(*tags) return yield unless logger if logger.respond_to?(:tagged) logger.tagged(*tags) { yield } else logger.info("Requested ERP with #{tags.join(', ')}") yield end end private attr_reader :logger end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
erp_integration-0.57.0 | lib/erp_integration/logger.rb |