Logs, prints, or raises a message.

    Arguments:
        message -- message to report
        severity -- string of one of these values:
            CRITICAL|ERROR|WARNING|INFO|DEBUG
548338
def log(message, severity="INFO", print_debug=True):
    

    print_me = ['WARNING', 'INFO', 'DEBUG']
    if severity in print_me:
        if severity == 'DEBUG':
            if print_debug:
                print("{0}: {1}".format(severity, message))
        else:
            print("{0}: {1}".format(severity, message))
    else:
        raise Exception("{0}: {1}".format(severity, message))
938638
def _log(self, message):
        
        self._logger.debug("{}: {}".format(self.name, message))
563121
def log_error(cls, msg):
        
        cls.error_logger.error(msg)
        cls.debug_logger.debug(msg)
1031829
def soft_error(self, message):
        

        self.print_usage(sys.stderr)
        args = {'prog': self.prog, 'message': message}
        self._print_message(
            _('%(prog)s: error: %(message)s\n') % args, sys.stderr)
1327474
def log_warning(self, msg):
        
        if self.__logger:
            self.__logger.warning(msg)

        if self.__raise_exception_on_warning:
            raise RuntimeError(msg)
1238330
public void severe(String message, Object... args) {
      log(Level.SEVERE, message, args);
   }
1355720
def debug(cls, message):
        
        if cls.verbose > 1:
            msg = '[DEBUG] %s' % message
            cls.echo(msg)
644478
def message(self_,msg,*args,**kw):
        
        self_.__db_print(INFO,msg,*args,**kw)
198584
def print_message(self, message="heya!"):
        
        if self.log == None: print(message)
        else:                self.log.append_text(message)
1337533
def logging_level(level):
    
    level = level.upper()
    levels = [DEBUG, INFO, WARNING, ERROR, CRITICAL, VERBOSE]
    level_names = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'VERBOSE']

    if level not in level_names:
        raise Exception("Level %r not in %r" % (level, levels))

    param_logger = get_logger()
    logging_level = param_logger.getEffectiveLevel()
    param_logger.setLevel(levels[level_names.index(level)])
    try:
        yield None
    finally:
        param_logger.setLevel(logging_level)
3399
def error(self, message):
        
        self.print_usage(_sys.stderr)
        self.exit(2, _('%s: error: %s\n') % (self.prog, message))
1271142
def log(self, level, msg):
        
        self._check_session()
        level = level.upper()
        allowed_levels = ('INFO', 'WARN', 'ERROR', 'FATAL')
        if level not in allowed_levels:
            raise ValueError('level must be one of: ' +
                             ', '.join(allowed_levels))
        self._rest.post_request(
            'log', None, {'log_level': level.upper(), 'message': msg})
1168502
def error(message)
      length = (position > 0 ? Tokenizer.query(symbols[0..(position - 1)]).size + 1 : 0)
      raise "parsing query failed\n#{message}\n\n#{Tokenizer.query(symbols)}\n#{' ' * length}^"
    rescue
      logger.error $!
      raise $!
    end
509543
def msg(message):
    
    to_stdout(" --- {message}".format(message=message))
    if _logger:
        _logger.info(message)
1046691
protected function log($message, $severity = LOG_INFO)
    {
        if (!isset($this->severityLabels[$severity])) {
            throw new Exception('Invalid severity value', 1426868867);
        }
        $this->importService->addEventMessage(sprintf('Record:Import:Log:%s', $this->severityLabels[$severity]), $message, $severity, $this->currentEvent);
    }
1013652
def exception(self, message, *args, **kwargs):
        
        self.logger.exception(message, *args, **kwargs)
699168
def log(self, msg, level=INFO):
        
        logger.log(level, '<{}> - '.format(self._name) + msg)