def add(severity, message=nil, progname=nil, shift=0, &block)
      return if (@level > severity)

      message = block.call if message.nil? && block_given?
      return if message.nil?

      called_by = parse_caller(caller[1+shift])

      message = [message.chomp, progname].flatten.compact.join(": ")
      message = "%19s.%06d|%05d|%5s|%s%s\n" % [Time.now.utc.strftime("%Y-%m-%d|%H:%M:%S"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message]

      @logdev.write(ZTK::ANSI.uncolor(message))
      @logdev.respond_to?(:flush) and @logdev.flush

      true
    end
def add(severity, message=nil, progname=nil, shift=0, &block)
      return if (@level > severity)

      message = block.call if message.nil? && block_given?
      return if message.nil?

      called_by = parse_caller(caller[1+shift])

      message = [message.chomp, progname].flatten.compact.join(": ")
      message = "%19s.%06d|%05d|%5s|%s%s\n" % [Time.now.utc.strftime("%Y-%m-%d|%H:%M:%S"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message]

      @logdev.write(ZTK::ANSI.uncolor(message))
      @logdev.respond_to?(:flush) and @logdev.flush

      true
    end
Writes a log message if the current log level is at or below the supplied
 severity.

 @param [Constant] severity Log level severity.
 @param [String] message Optional message to prefix the log entry with.
 @param [String] progname Optional name of the program to prefix the log
   entry with.
 @yieldreturn [String] The block should return the desired log message.