Log a message with CRITICAL level. Automatically includes stack and
        process info unless they are specifically not included.
347678
def critical(self, msg, *args, **kwargs):
        
        kwargs.setdefault('inc_stackinfo', True)
        kwargs.setdefault('inc_multiproc', True)
        self.log(CRITICAL, msg, args, **kwargs)
588987
def critical(self, msg, *args, **kwargs) -> Task:  # type: ignore
        
        return self._make_log_task(logging.CRITICAL, msg, args, **kwargs)
262226
def log (self, msg, prefix=None):
    """"""
    if prefix:
      if not prefix.strip().endswith(':'):
        prefix += ': '
      msg = prefix + msg
    self.messages.append(msg)
911036
def log_message(self, kind, alert):
        """"""
        if kind == 'ERROR':
            logging.error(alert)
        else:
            logging.warning(alert)
        return
1286759
def py_log_level(self, default='none'):
        ''' 

        '''
        level = self._get_str("PY_LOG_LEVEL", default, "debug")
        LEVELS = {'trace': logging.TRACE,
                  'debug': logging.DEBUG,
                  'info' : logging.INFO,
                  'warn' : logging.WARNING,
                  'error': logging.ERROR,
                  'fatal': logging.CRITICAL,
                  'none' : None}
        return LEVELS[level]
1090515
function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        }
840229
def log(priority, msg)
      @logger.tagged(Time.now.to_s, Process.pid, to_s) do
        @logger.send(priority, msg)
      end
    end
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
1267593
def _logger(self):
        
        log_level = {
            'debug': logging.DEBUG,
            'info': logging.INFO,
            'warning': logging.WARNING,
            'error': logging.ERROR,
            'critical': logging.CRITICAL,
        }
        level = log_level.get(self.args.logging_level.lower())

        # Formatter
        tx_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s '
        tx_format += '(%(funcName)s:%(lineno)d)'
        formatter = logging.Formatter(tx_format)

        # Logger
        log = logging.getLogger('tcrun')

        # # Stream Handler
        # sh = logging.StreamHandler()
        # sh.set_name('sh')
        # sh.setLevel(level)
        # sh.setFormatter(formatter)
        # log.addHandler(sh)

        # File Handler
        if not os.access('log', os.W_OK):
            os.makedirs('log')
        logfile = os.path.join('log', 'run.log')
        fh = logging.FileHandler(logfile)
        fh.set_name('fh')
        fh.setLevel(logging.DEBUG)
        fh.setFormatter(formatter)
        log.addHandler(fh)

        log.setLevel(level)
        log.info('Logging Level: {}'.format(logging.getLevelName(level)))
        return log
58914
def log_stack(logger, level=logging.INFO, limit=None, frame=None):
    
    if showing_stack.inside:
        return
    showing_stack.inside = True
    try:
        if frame is None:
            frame = sys._getframe(1)
        stack = "".join(traceback.format_stack(frame, limit))
        for line in (l[2:] for l in stack.split("\n") if l.strip()):
            logger.log(level, line)
    finally:
        showing_stack.inside = False
1327474
def log_warning(self, msg):
        
        if self.__logger:
            self.__logger.warning(msg)

        if self.__raise_exception_on_warning:
            raise RuntimeError(msg)
1234142
def initialise_logging(level: str, target: str, short_format: bool):
    """"""
    try:
        log_level = getattr(logging, level)
    except AttributeError:
        raise SystemExit(
            "invalid log level %r, expected any of 'DEBUG', 'INFO', 'WARNING', 'ERROR' or 'CRITICAL'" % level
        )
    handler = create_handler(target=target)
    logging.basicConfig(
        level=log_level,
        format='%(asctime)-15s (%(process)d) %(message)s' if not short_format else '%(message)s',
        datefmt='%Y-%m-%d %H:%M:%S',
        handlers=[handler]
    )
85708
def log_level(self, level):
        
        if 0 <= level <= 7:
            for i in range(level+1):
                self.add_match(PRIORITY="%d" % i)
        else:
            raise ValueError("Log level must be 0 <= level <= 7")
682703
def _log_message(self, level, process_name, timeperiod, msg):
        
        self.timetable.add_log_entry(process_name, timeperiod, msg)
        self.logger.log(level, msg)
740497
def log(message, level=None):
    """"""
    command = ['juju-log']
    if level:
        command += ['-l', level]
    if not isinstance(message, six.string_types):
        message = repr(message)
    command += [message[:SH_MAX_ARG]]
    # Missing juju-log should not cause failures in unit tests
    # Send log output to stderr
    try:
        subprocess.call(command)
    except OSError as e:
        if e.errno == errno.ENOENT:
            if level:
                message = "{}: {}".format(level, message)
            message = "juju-log: {}".format(message)
            print(message, file=sys.stderr)
        else:
            raise
822856
def log(self, level, msg):
        
        if self.isDestroyed():
            return
        
        locker = QtCore.QMutexLocker(self._mutex)
        try:
            msg = projex.text.nativestring(msg)
            self.moveCursor(QtGui.QTextCursor.End)
            self.setCurrentMode(level)
            if self.textCursor().block().text():
                self.insertPlainText('\n')
            self.insertPlainText(msg.lstrip('\n\r'))
            self.scrollToEnd()
        except RuntimeError:
            return
        
        if not self.signalsBlocked():
            self.messageLogged.emit(level, msg)
        
        return True
215819
def push_log(self, info, level=None, *args, **kwargs):
        
        if args:
            msg = info % args
        else:
            msg = info
        try:
            puts('docker: {0}'.format(msg))
        except UnicodeDecodeError:
            puts('docker: -- non-printable output --')