def info message
   add Logger::INFO, "INFO:#{message}"
 end
 def debug message
   add Logger::DEBUG, "DEBUG:#{message}"
 end
 def error message
   add Logger::ERROR, "ERROR:#{message}"
 end
348656
def add severity, message, context = nil, details = nil
      # Start from an empty messages list with the main message
      messages = []
      messages << sprintf(@format[:text], message) if message

      # Add raw lines
      if context.nil? && (details.is_a? Array)
        messages = details

      # Add details from array
      elsif details.is_a? Array
        details.each do |line|
          messages << sprintf(@format[:array], line)
        end 

      # Add details from hash
      elsif details.is_a?(Hash) || details.is_a?(Hashie::Mash)
        details.each do |key, value|
          messages << sprintf(@format[:hash], key, value)
        end 

      # Add each line of "details" after split
      elsif details.is_a? String
        details.lines.each do |line|
          messages << line unless line.empty?
        end 
    
      end

      # Pass all that stuff to my parent
      super severity, messages, context
    end
975038
def loginfo(logger, msg, *args, **kwargs):
    '''
    
    '''
    if esgfpid.defaults.LOG_INFO_TO_DEBUG:
        logger.debug(msg, *args, **kwargs)
    else:
        logger.info(msg, *args, **kwargs)
74489
def debug(msg = nil)
      if @logger
        msg = build_log(msg || yield, ActionCommand::LOG_KIND_DEBUG)
        @logger.info(format_log(msg))
      end
    end
1277105
def log(level, message = nil)
      level, message = :info, level if message.nil?
      Resqued::Logging.logger.send(level, self.class.name) { message }
    end
238379
def information(self, message, *args, **kwargs):
        """"""
        self.log("info", message, *args, **kwargs)
1285243
def loginfo(message)
      file, line, function = caller[0].split(':')
      @logger.log('INFO', message, file, function, line.to_i)
      self
    end
735954
def error(msg)
      if @logger
        msg = build_log(msg, ActionCommand::LOG_KIND_ERROR)
        @logger.error(format_log(msg))
      end
    end
717563
def add_error(key, kind, message = nil)
      raise ArgumentError.new("Invalid kind") unless kind.is_a?(Symbol)

      @errors ||= ErrorHash.new
      @errors.tap do |errs|
        path = key.to_s.split(".")
        last = path.pop
        inner = path.inject(errs) do |cur_errors,part|
          cur_errors[part.to_sym] ||= ErrorHash.new
        end
        inner[last] = ErrorAtom.new(key, kind, :message => message)
      end
    end
1165976
def log_error(self, error, message, detail=None, strip=4):
        ""
        if message:
            msg = message + ": " + error
        else:
            msg = error

        tb = traceback.format_stack()
        if sys.version_info >= (3, 0):
            tb = tb[:-strip]
        else:
            tb = tb[strip:]

        self.errors.append({
            'message': msg,
            'traceback': tb,
            'detail': detail
        })
541290
def add_error(e)
      @data[:error] = true

      if @data.key?(:ec)
        @data[:ec] = @data[:ec] + 1
      else
        @data[:ec] = 1
      end

      # If a valid exception has been passed in, log the information about it
      # In case of just logging an error for things such as HTTP client 5xx
      # responses, an exception/backtrace may not exist.
      if e
        if e.backtrace.is_a?(Array)
          add_stack(stack: e.backtrace)
        end

        if HTTP_SPANS.include?(@data[:n])
          set_tags(:http => { :error => "#{e.class}: #{e.message}" })
        else
          log(:error, Time.now, { :message => e.message, :parameters => e.class.to_s })
        end
        e.instance_variable_set(:@instana_logged, true)
      end
      self
    end
294237
def setup_debug_logging():
    

    logger = logging.getLogger("xbahn")
    logger.setLevel(logging.DEBUG)

    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter("%(name)s: %(message)s"))

    logger.addHandler(ch)
701014
def display_error_message(ex)
      $stderr.puts "#{name} aborted!"
      $stderr.puts ex.message
      if options.trace
        $stderr.puts ex.backtrace.join("\n")
      else
        $stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
        $stderr.puts "(See full trace by running task with --trace)"
      end
    end
211990
def error_info(hash)      
      if hash && (e = hash["Error"]) && (e["ErrorNumber"] || e["ErrorMessage"])
        return OpenStruct.new(:number => e["ErrorNumber"], :message => e["ErrorMessage"])
      end

      # Or wait! Some API's have a totally different way of reporting errors, great!
      if hash && (e = hash["Authentication"]) && e["Problem"] 
        return OpenStruct.new(:number => e["Problem"]["Code"], :message => e["Problem"]["Message"])
      end

      # And one more for Auth errors! With no error number, hooray. 
      if hash && (e = hash["AuthorizationState"]) && e["State"] == "failed"
        return OpenStruct.new(:number => nil, :message => "AuthorizationState: State: failed")
      end

      # And yet another way!
      if hash && (e = hash["Problem"])
        # Code/Message appear unpredictably at different keys? 
        return OpenStruct.new(:number => e["ErrorCode"] || e["Code"], :message => e["ErrorMessage"] || e["Message"])
      end

      return nil    
    end
1082020
function _Error() {
    this.populate.apply(this, arguments);
    var stack = (new Error(this.message)).stack;
    debug('stack ', stack);
}
535792
def default_logger
      logger = Logger.new(STDOUT)
      logger.level = Logger::INFO
      logger
    end
1095351
def log(self, message, level='info'):
        
        getattr(self.logger, level)('[%s] %s' % (self.id, message))
575066
def method_missing(meth, *args, &block)
      @namespace = meth.to_s
      @message   = (args.first.to_s == 'debug') ? nil : args.first.to_s
      self.send :output!
    end