logs message with status code 2 - critical
13581
@Override
    public void sendError(String message) {
        System.out.print("Critical: " + message);
        System.exit(2);
    }
660836
def log_status(self, in_sync=True, incremental=False, audit=False,
                   same=None, created=0, updated=0, deleted=0, to_delete=0):
        
        if (audit):
            words = {'created': 'to create',
                     'updated': 'to update',
                     'deleted': 'to delete'}
        else:
            words = {'created': 'created',
                     'updated': 'updated',
                     'deleted': 'deleted'}
        if in_sync:
            # status rather than action
            status = "NO CHANGES" if incremental else "IN SYNC"
        else:
            if audit:
                status = "NOT IN SYNC"
            elif (to_delete > deleted):
                # will need --delete
                status = "PART APPLIED" if incremental else"PART SYNCED"
                words['deleted'] = 'to delete (--delete)'
                deleted = to_delete
            else:
                status = "CHANGES APPLIED" if incremental else "SYNCED"
        same = "" if (same is None) else ("same=%d, " % same)
        self.logger.warning("Status: %15s (%s%s=%d, %s=%d, %s=%d)" %
                            (status, same, words['created'], created,
                             words['updated'], updated, words['deleted'], deleted))
859989
def post_message(self, msg):
        ''''''
        if '_posted' in msg.__dict__:
            return
        msg._posted = True
        msg._timestamp = time.time()
        type = msg.get_type()
        if type != 'HEARTBEAT' or (msg.type != mavlink.MAV_TYPE_GCS and msg.type != mavlink.MAV_TYPE_GIMBAL):
            self.messages[type] = msg

        if 'usec' in msg.__dict__:
            self.uptime = msg.usec * 1.0e-6
        if 'time_boot_ms' in msg.__dict__:
            self.uptime = msg.time_boot_ms * 1.0e-3

        if self._timestamp is not None:
            if self.notimestamps:
                msg._timestamp = self.uptime
            else:
                msg._timestamp = self._timestamp

        src_system = msg.get_srcSystem()
        src_component = msg.get_srcComponent()
        src_tuple = (src_system, src_component)
        radio_tuple = (ord('3'), ord('D'))
        if not (src_tuple == radio_tuple or msg.get_type() == 'BAD_DATA'):
            if not src_tuple in self.last_seq:
                last_seq = -1
            else:
                last_seq = self.last_seq[src_tuple]
            seq = (last_seq+1) % 256
            seq2 = msg.get_seq()
            if seq != seq2 and last_seq != -1:
                diff = (seq2 - seq) % 256
                self.mav_loss += diff
                #print("lost %u seq=%u seq2=%u last_seq=%u src_system=%u %s" % (diff, seq, seq2, last_seq, src_system, msg.get_type()))
            self.last_seq[src_tuple] = seq2
            self.mav_count += 1
        
        self.timestamp = msg._timestamp
        if type == 'HEARTBEAT' and msg.get_srcComponent() != mavlink.MAV_COMP_ID_GIMBAL:
            self.target_system = msg.get_srcSystem()
            self.target_component = msg.get_srcComponent()
            if float(mavlink.WIRE_PROTOCOL_VERSION) >= 1 and msg.type != mavlink.MAV_TYPE_GCS:
                self.flightmode = mode_string_v10(msg)
                self.mav_type = msg.type
                self.base_mode = msg.base_mode
        elif type == 'PARAM_VALUE':
            s = str(msg.param_id)
            self.params[str(msg.param_id)] = msg.param_value
            if msg.param_index+1 == msg.param_count:
                self.param_fetch_in_progress = False
                self.param_fetch_complete = True
        elif type == 'SYS_STATUS' and mavlink.WIRE_PROTOCOL_VERSION == '0.9':
            self.flightmode = mode_string_v09(msg)
        elif type == 'GPS_RAW':
            if self.messages['HOME'].fix_type < 2:
                self.messages['HOME'] = msg
        elif type == 'GPS_RAW_INT':
            if self.messages['HOME'].fix_type < 3:
                self.messages['HOME'] = msg
        for hook in self.message_hooks:
            hook(self, msg)

        if (msg.get_signed() and
            self.mav.signing.link_id == 0 and
            msg.get_link_id() != 0 and
            self.target_system == msg.get_srcSystem() and
            self.target_component == msg.get_srcComponent()):
            # change to link_id from incoming packet
            self.mav.signing.link_id = msg.get_link_id()
1298010
def log(level, message, line_prefix=nil)
      if level <= self.level
        indent = "%*s" % [Capistrano::Logger::MAX_LEVEL, "*" * (Capistrano::Logger::MAX_LEVEL - level)]
        (RUBY_VERSION >= "1.9" ? message.lines : message).each do |line|
          if line_prefix
            self.class.log_with_awesome "#{indent} [#{line_prefix}] #{line.strip}"
          else
            self.class.log_with_awesome "#{indent} #{line.strip}"
          end
        end
      end
      super(level, message, line_prefix)
    end
428713
def log_status(cmd, message, verbose, color = false)
      return unless verbose

      cmd = cmd.to_s.rjust(12)
      if color
        i = cmd.index(/[a-z]/)
        cmd = cmd[0...i] + decorate(cmd[i..-1], color)
      end

      message = "#{cmd}  #{message}"
      message += "\n" unless message.end_with?("\n")

      @output.print(message)
      @output.flush
    end
839944
def critical(self, message, *args, **kwargs):
        
        self.system.critical(message, *args, **kwargs)
176457
def raise_alert_log_entry(self):
        
        if self.__class__.log_alerts:
            log_level = 'info'
            if self.state == 'DOWN':
                log_level = 'error'
            if self.state == 'UNREACHABLE':
                log_level = 'warning'
            brok = make_monitoring_log(
                log_level, 'HOST ALERT: %s;%s;%s;%d;%s' % (
                    self.get_name(), self.state, self.state_type, self.attempt, self.output
                )
            )
            self.broks.append(brok)

        if 'ALIGNAK_LOG_ALERTS' in os.environ:
            if os.environ['ALIGNAK_LOG_ALERTS'] == 'WARNING':
                logger.warning('HOST ALERT: %s;%s;%s;%d;%s', self.get_name(), self.state,
                               self.state_type, self.attempt, self.output)
            else:
                logger.info('HOST ALERT: %s;%s;%s;%d;%s', self.get_name(), self.state,
                            self.state_type, self.attempt, self.output)
402140
public void log(Priority priority, Object message, Throwable t) {
        if (repository.isDisabled(priority.level)) {
            return;
        }
        if (priority.isGreaterOrEqual(this.getEffectiveLevel()))
            forcedLog(FQCN, priority, message, t);
    }
1168983
def c_log(level, message):
    """"""
    c_level = level
    level = LEVELS_F2PY[c_level]
    logger.log(level, message)
1316311
def critical(self, msg):
        
        self._execActions('critical', msg)
        msg = self._execFilters('critical', msg)
        self._processMsg('critical', msg)
        self._sendMsg('critical', msg)
87621
protected void pacedErrorLog(String message, Object arg1, Object arg2) {
    pacer.pacedCall(() -> LOGGER.error(message + " - Similar messages will be suppressed for 30 seconds", arg1, arg2), () -> LOGGER.debug(message, arg1, arg2));
  }
1274101
public void log(String FQCN, Priority p, Object msg, Throwable t) {
        int levelInt = priorityToLevelInt(p);
        differentiatedLog(null, FQCN, levelInt, msg, t);
    }
795597
def raise_check_result(self):
        
        if not self.__class__.log_active_checks:
            return

        log_level = 'info'
        if self.state in [u'WARNING', u'UNREACHABLE']:
            log_level = 'warning'
        elif self.state == u'CRITICAL':
            log_level = 'error'
        brok = make_monitoring_log(
            log_level, 'ACTIVE SERVICE CHECK: %s;%s;%s;%d;%s' % (self.host_name, self.get_name(),
                                                                 self.state, self.attempt,
                                                                 self.output)
        )
        self.broks.append(brok)
849544
def log_warn(message, args):
    """"""
    get_logger(DEFAULT_LOGGER, log_creation=False).log(logging.WARNING, message, *args)
1048824
def status_log(func, message, *args, **kwargs):
    """"""

    click.echo(message)
    log = func(*args, **kwargs)

    if log:
        out = []

        for line in log.split('\n'):
            if not line.startswith('#'):
                out.append(line)
        click.echo(black('\n'.join(out)))
479059
def log(msg, level=0):
    '''
    
    '''

    red = '\033[91m'
    endc = '\033[0m'

    # configure the logging module
    cfg = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'stdout': {
                'format': '[%(levelname)s]: %(asctime)s - %(message)s',
                'datefmt': '%x %X'
            },
            'stderr': {
                'format': red + '[%(levelname)s]: %(asctime)s - %(message)s' + endc,
                'datefmt': '%x %X'
            }
        },
        'handlers': {
            'stdout': {
                'class': 'logging.StreamHandler',
                'level': 'DEBUG',
                'formatter': 'stdout'
            },
            'stderr': {
                'class': 'logging.StreamHandler',
                'level': 'ERROR',
                'formatter': 'stderr'
            }
        },
        'loggers': {
            'info': {
                'handlers': ['stdout'],
                'level': 'INFO',
                'propagate': True
            },
            'error': {
                'handlers': ['stderr'],
                'level': 'ERROR',
                'propagate': False
            }
        }
    }

    dictConfig(cfg)

    lg = 'info' if level == 0 else 'error'
    lvl = 20 if level == 0 else 40

    logger = logging.getLogger(lg)
    logger.log(lvl, msg)
1314833
def _log(self, message, severity=Logger.DEBUG):
        
        return self.logger.log(message, severity, self.TAG)