Sha256: 4a057be96307ab0655cc34eab078500a17ec56f1d82bfea81e3d767a787d46a1

Contents?: true

Size: 390 Bytes

Versions: 25

Compression:

Stored size: 390 Bytes

Contents

require "logger"

module GLogger
  def initialize_logger log_file
    return unless log_file
    @logger =
      if log_file == "-"
        Logger.new($stdout)
      else
        Logger.new(log_file)
      end
    @logger.datetime_format = "%Y-%m-%d %H:%M:%S "
  end

  def log text
    @logger.info(text) if @logger
  end

  def log_error text
    @logger.error(text) if @logger
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gorgon-0.6.3 lib/gorgon/g_logger.rb
gorgon-0.6.2 lib/gorgon/g_logger.rb
gorgon-0.6.1 lib/gorgon/g_logger.rb
gorgon-0.6.0 lib/gorgon/g_logger.rb
gorgon-0.6.0.rc2 lib/gorgon/g_logger.rb
gorgon-0.6.0.rc1 lib/gorgon/g_logger.rb
gorgon-0.5.0.rc1 lib/gorgon/g_logger.rb
gorgon-0.4.5 lib/gorgon/g_logger.rb
gorgon-0.4.5.rc1 lib/gorgon/g_logger.rb
gorgon-0.4.4 lib/gorgon/g_logger.rb
gorgon-0.4.3 lib/gorgon/g_logger.rb
gorgon-0.4.2 lib/gorgon/g_logger.rb
gorgon-0.4.1 lib/gorgon/g_logger.rb
gorgon-0.4.1.rc1 lib/gorgon/g_logger.rb
gorgon-0.4.0 lib/gorgon/g_logger.rb
gorgon-0.4.0.rc2 lib/gorgon/g_logger.rb
gorgon-0.4.0.rc1 lib/gorgon/g_logger.rb
gorgon-0.3.2 lib/gorgon/g_logger.rb
gorgon-0.3.1 lib/gorgon/g_logger.rb
gorgon-0.3.0 lib/gorgon/g_logger.rb