Sha256: beab16a917effba1097fad47f706ce485f57bd80dd2618f437dff7ca4a9c3f5e

Contents?: true

Size: 579 Bytes

Versions: 14

Compression:

Stored size: 579 Bytes

Contents

module Synchronisable
  module Helper
    # Provides logging helper methods.
    # Class or module that includes this one
    # should implement `logger` method.
    #
    # @api private
    module Logging
      protected

      %i(verbose colorize).each do |name|
        define_method("#{name}_logging?".to_sym) do
          Synchronisable.config.logging[name]
        end
      end

      def log_info(msg, color = :white, force = true)
        text = msg.colorize(color) if colorize_logging?
        logger.info(text) if force || verbose_logging?
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
synchronisable-1.3.1 lib/synchronisable/helper/logging.rb
synchronisable-1.3.0 lib/synchronisable/helper/logging.rb
synchronisable-1.2.7 lib/synchronisable/helper/logging.rb
synchronisable-1.2.6 lib/synchronisable/helper/logging.rb
synchronisable-1.2.5 lib/synchronisable/helper/logging.rb
synchronisable-1.2.4 lib/synchronisable/helper/logging.rb
synchronisable-1.2.3 lib/synchronisable/helper/logging.rb
synchronisable-1.2.2 lib/synchronisable/helper/logging.rb
synchronisable-1.2.1 lib/synchronisable/helper/logging.rb
synchronisable-1.2.0 lib/synchronisable/helper/logging.rb
synchronisable-1.1.9 lib/synchronisable/helper/logging.rb
synchronisable-1.1.8 lib/synchronisable/helper/logging.rb
synchronisable-1.1.7 lib/synchronisable/helper/logging.rb
synchronisable-1.1.6 lib/synchronisable/helper/logging.rb