def add(severity, message = nil, progname = nil, &block)
      severity ||= UNKNOWN
      if @logdev.nil? or severity < @level
        return true
      end
      progname ||= @progname
      if message.nil?
        if block_given?
  	       message = yield
        else
  	      message = progname
  	      progname = @progname
        end
      end
      @logdev.write(
        format_message(format_severity(severity), Time.now, progname, message))
      true
    end
def add(severity, message = nil, progname = nil, &block)
      severity ||= UNKNOWN
      if @logdev.nil? or severity < @level
        return true
      end
      progname ||= @progname
      if message.nil?
        if block_given?
  	       message = yield
        else
  	      message = progname
  	      progname = @progname
        end
      end
      @logdev.write(
        format_message(format_severity(severity), Time.now, progname, message))
      true
    end
=== Synopsis

   Logger.new(name)
   Logger.new(name)

 === Args

 +logdev+::
   The log device.  This is a filename (String) or IO object (typically
   +STDOUT+, +STDERR+, or an open file).

 === Description

 Create an instance.


 === Synopsis

   Logger#add(severity, message = nil, progname = nil) { ... }

 === Args

 +severity+::
   Severity.  Constants are defined in Logger namespace: +DEBUG+, +INFO+,
   +WARN+, +ERROR+, +FATAL+, or +UNKNOWN+.
 +message+::
   The log message.  A String or Exception.
 +progname+::
   Program name string.  Can be omitted.  Treated as a message if no
   +message+ and +block+ are given.
 +block+::
   Can be omitted.  Called to get a message string if +message+ is nil.

 === Return

 +true+ if successful, +false+ otherwise.

 When the given severity is not high enough (for this particular logger), log
 no message, and return +true+.

 === Description

 Log a message if the given severity is high enough.  This is the generic
 logging method.  Users will be more inclined to use #debug, #info, #warn,
 #error, and #fatal.

 <b>Message format</b>: +message+ can be any object, but it has to be
 converted to a String in order to log it.  Generally, +inspect+ is used
 if the given object is not a String.
 A special case is an +Exception+ object, which will be printed in detail,
 including message, class, and backtrace.  See #msg2str for the
 implementation if required.

 === Bugs

 * Logfile is not locked.
 * Append open does not need to lock file.
 * If the OS which supports multi I/O, records possibly be mixed.