Enable contextual logging
337606
def enable(self):
        """"""
        with self._lock:
            if self.filter is None:
                self.filter = self._filter_type(self)
812608
def enable_log(level=logging.DEBUG):
    
    logger = logging.getLogger(__name__)
    logger.setLevel(level)
    if not logger.handlers:
        logger.info('enabling logging to console.')
        logger.addHandler(logging.StreamHandler(sys.stdout))
1058643
void contextCommandString(StringBuilder buf, String uri, Context.Status status, String path, List<String> alias, String jvmRoute) {
        switch (status) {
            case DISABLED:
                buf.append("<a href=\"" + uri + "?" + getNonce() + "&Cmd=ENABLE-APP&Range=CONTEXT&");
                contextString(buf, path, alias, jvmRoute);
                buf.append("\">Enable</a> ");
                break;
            case ENABLED:
                buf.append("<a href=\"" + uri + "?" + getNonce() + "&Cmd=DISABLE-APP&Range=CONTEXT&");
                contextString(buf, path, alias, jvmRoute);
                buf.append("\">Disable</a> ");
                break;
        }
    }
310044
def log_context(trace_level, stream):
    '''
    
    '''
    original_trace_level = DebugInfoHolder.DEBUG_TRACE_LEVEL
    original_stream = DebugInfoHolder.DEBUG_STREAM

    DebugInfoHolder.DEBUG_TRACE_LEVEL = trace_level
    DebugInfoHolder.DEBUG_STREAM = stream
    try:
        yield
    finally:
        DebugInfoHolder.DEBUG_TRACE_LEVEL = original_trace_level
        DebugInfoHolder.DEBUG_STREAM = original_stream
645559
def added(self, context):
        
        self._expose_argparse = context.bowl.has_spice("log:arguments")
        self.configure_logging(context)
632772
def setup_logging(format="%(asctime)s - %(levelname)s - %(message)s", level='INFO'):
    """"""
    try:
        import coloredlogs
        coloredlogs.install(fmt=format, level=level)
    except ImportError:
        logging.basicConfig(format=format, level=level)
808714
def set_context(self, new_context):
        """"""
        self._context = new_context

        if hasattr(self, '_set_logging_context'):
            self._set_logging_context(self._context)
70277
def enable_logging(self):
        
        handler = logging.FileHandler(self.log_fname)
        handler.setLevel(logging.INFO)
        run_id = self.id

        class WBFilter(logging.Filter):
            def filter(self, record):
                record.run_id = run_id
                return True

        formatter = logging.Formatter(
            '%(asctime)s %(levelname)-7s %(threadName)-10s:%(process)d [%(run_id)s:%(filename)s:%(funcName)s():%(lineno)s] %(message)s')
        handler.setFormatter(formatter)
        handler.addFilter(WBFilter())

        root = logging.getLogger()
        root.addHandler(handler)
267171
function ( enabled, debug ) {
		this.logging.enabled = enabled === true;
		this.logging.debug = debug === true;
		this.meshBuilder.setLogging( this.logging.enabled, this.logging.debug );
	}
985022
def setup_logging(cli_options):
    """"""
    if cli_options.debug_info or get_debug_level() > 0:
        levels = {2: logging.INFO, 3: logging.DEBUG}
        log_level = levels[get_debug_level()]
        log_format = '%(asctime)s [%(levelname)s] [%(name)s] -> %(message)s'

        if cli_options.debug_output == 'file':
            log_file = 'spyder-debug.log'
        else:
            log_file = None

        logging.basicConfig(level=log_level,
                            format=log_format,
                            filename=log_file,
                            filemode='w+')
302328
def _init_logging(verbose):
    """"""
    hdlr = logging.StreamHandler()
    hdlr.setFormatter(logging.Formatter(
        '%(asctime)s [%(levelname)s] [%(module)s] %(message)s'))
    LOG.addHandler(hdlr)
    if verbose:
        LOG.setLevel(logging.DEBUG)
        LOG.debug('Verbose output enabled.')
    else:
        LOG.setLevel(logging.INFO)
394009
def configure_logging():
  """"""

  # Define the top-level logger.
  htf_logger = logging.getLogger(LOGGER_PREFIX)
  htf_logger.propagate = False
  htf_logger.setLevel(logging.DEBUG)

  # By default, don't print any logs to the CLI.
  if CLI_LOGGING_VERBOSITY == 0:
    htf_logger.addHandler(logging.NullHandler())
    return

  if CLI_LOGGING_VERBOSITY == 1:
    logging_level = logging.INFO
  else:
    logging_level = logging.DEBUG

  # Configure a handler to print to the CLI.
  cli_handler = KillableThreadSafeStreamHandler(stream=sys.stdout)
  cli_handler.setFormatter(CliFormatter())
  cli_handler.setLevel(logging_level)
  cli_handler.addFilter(MAC_FILTER)
  htf_logger.addHandler(cli_handler)

  # Suppress CLI logging if the --quiet flag is used, or while CLI_QUIET is set
  # in the console_output module.
  cli_handler.addFilter(console_output.CliQuietFilter())
808563
def format_log_context(msg, connection=None, keyspace=None):
    """"""
    connection_info = connection or 'DEFAULT_CONNECTION'

    if keyspace:
        msg = '[Connection: {0}, Keyspace: {1}] {2}'.format(connection_info, keyspace, msg)
    else:
        msg = '[Connection: {0}] {1}'.format(connection_info, msg)
    return msg
1304982
def setup_logging():
    
    fmt = 'DBG<0>%(pathname)s:%(lineno)d  %(funcName)s: %(message)s'

    handler_stderr = logging.StreamHandler(sys.stderr)
    handler_stderr.setFormatter(logging.Formatter(fmt))

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.DEBUG)
    root_logger.addHandler(handler_stderr)
266735
public static ContextualLogger getLogger(String name, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(name), context);
  }
532996
function setupLogger(logger, path, context, applicationConfig) {
    logger.startContext(context);
    logger.setLevel(applicationConfig[path].logLevel);

    if (AmorphicContext.appContext.sendToLog) {
        logger.sendToLog = AmorphicContext.appContext.sendToLog;
    }
}
1095976
def add_log_callback(callback):
    """"""
    global _log_callbacks

    if not callable(callback):
        raise ValueError("Callback must be callable")

    _log_callbacks.add(callback)
    return callback