lib/spawning_logger.rb
# creates a logger for child_name. uses child_name and
# child_prefix (if configured) for construction of the new logger's filename.
#
# example:
#   origfile.log => origfile_childprefix_childname.log
#
creates a logger for child_name. uses child_name and
child_prefix (if configured) for construction of the new logger's filename.


creates a logger for child_name . uses child_name and child_prefix ( if configured ) for construction of the new logger ' s filename .
def create_child_logger(child_name)
      parent_filename = File.basename(@file_name, File.extname(@file_name))
      file_basename = [
        parent_filename, @@child_prefix, child_name
      ].compact.join('_')
      file_name = file_basename + File.extname(@file_name)
      file_path = File.join(@log_base_dir, file_name)
      self.class.new(file_path)
    end
def create_child_logger ( child_name ) parent_filename = File . basename ( @file_name , File . extname ( @file_name ) ) file_basename = [ parent_filename , @@child_prefix , child_name ] . compact . join ( '_' ) file_name = file_basename + File . extname ( @file_name ) file_path = File . join ( @log_base_dir , file_name ) self . class . new ( file_path ) end
creates a logger for child_name.
creates a logger for child_name .
# remove extension # add child_prefix + child_id # add extension # use base dir without subdir, because child logger adds it itself
child_name