Sha256: b9422f674aea305df584a1d70cfe4fe4a05cc53eda7e0f39e0cfc60980682617

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

# coding: utf-8
# $BUILTIN
# $NAME logger
# $SERVICE Carioca::Services::InternalLogger
# $RESOURCE logger
# $DESCRIPTION The standard ruby Logger internal wrapper Service for Carioca
# $INIT_OPTIONS target => /tmp/log.file
# Copyright Ultragreen (c) 2005
#---
# Author : Romain GEORGES
# type : class definition Ruby
# obj : Generic config library
#---
# $Id$

require 'rubygems'
require 'logger'
require 'methodic'

module Carioca
  module Services

    # Service Logger (InternalLogger) of Carioca,
    # @note integrally based on Logger from logger Gem
    class InternalLogger < Logger

      private

      # logger service constructor (open log)
      # @param [Hash] _options the params
      # @option _options [String] :target the filename where to log
      def initialize(_options = {})
        options = Methodic.get_options(_options)
        options.specify_default_value :target => STDOUT
        options.merge
        super(options[:target])
      end

      # garbage service hook
      # @note close the logger
      def garbage
        self.close
      end

    end
  end



end


# interactive hacks
if $0 == __FILE__ then
  puts "#{File::basename(__FILE__)}:"
  puts 'this is a RUBY library file'
  puts "Copyright (c) Ultragreen"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
carioca-1.4 lib/carioca/services/logger.rb