コード例 #1
0
    def log_error(self, message, name=None):
        """Logs a message at ERROR log level.

    ERROR log level is recorded on LogSources with any verbosity level.

    Args:
      message: A string message to be logged.
      name: A string name representing the source of the message. Defaults to
          none. How this is used is up to the LogSource.
    """
        if self._should_log(enums.LogLevel.ERROR):
            message = '[%s] %s' % (enums.log_level_to_string(
                enums.LogLevel.ERROR), message)
            self._log_internal(
                (enums.LogLevel.ERROR, util.timer(), name, message))
コード例 #2
0
ファイル: build_logging.py プロジェクト: google/anvil-build
  def log_error(self, message, name=None):
    """Logs a message at ERROR log level.

    ERROR log level is recorded on LogSources with any verbosity level.

    Args:
      message: A string message to be logged.
      name: A string name representing the source of the message. Defaults to
          none. How this is used is up to the LogSource.
    """
    if self._should_log(enums.LogLevel.ERROR):
      message = '[%s] %s' % (
        enums.log_level_to_string(enums.LogLevel.ERROR), message)
      self._log_internal(
        (enums.LogLevel.ERROR, util.timer(), name, message))
コード例 #3
0
    def log_info(self, message, name=None):
        """Logs a message at INFO log level.

    INFO log level is recorded on LogSources with VERBOSE or NORMAL verbosity.

    Args:
      message: A string message to be logged.
      name: A string name representing the source of the message. Defaults to
          none. How this is used is up to the LogSource.
    """
        if self._should_log(enums.LogLevel.INFO):
            message = '[%s] %s' % (enums.log_level_to_string(
                enums.LogLevel.INFO), message)
            self._log_internal(
                (enums.LogLevel.INFO, util.timer(), name, message))
コード例 #4
0
ファイル: build_logging.py プロジェクト: google/anvil-build
  def log_info(self, message, name=None):
    """Logs a message at INFO log level.

    INFO log level is recorded on LogSources with VERBOSE or NORMAL verbosity.

    Args:
      message: A string message to be logged.
      name: A string name representing the source of the message. Defaults to
          none. How this is used is up to the LogSource.
    """
    if self._should_log(enums.LogLevel.INFO):
      message = '[%s] %s' % (
        enums.log_level_to_string(enums.LogLevel.INFO), message)
      self._log_internal(
        (enums.LogLevel.INFO, util.timer(), name, message))