lib/services/logger.rb in carioca-0.1 vs lib/services/logger.rb in carioca-1.0

- old
+ new

@@ -1,38 +1,44 @@ #!/usr/bin/env ruby +# $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 - # constructor type could be a section name in <get_sections> result - # override could be true of false and precise if the block of the application have - # to override the main config hash result, default is true - def initialize(_options) + + # 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_of :target => STDOUT - options.validate! - + 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