Simple bootstrapper for attaching logger and watch plugins by default. Other plugins can be attached through `monitor.use(plugin, options)`.
195998
function bootstrap(monitor) {
    plugins.logger.attach.call(monitor, options);
    if (options.watch) {
      plugins.watch.attach.call(monitor, options);
    }
  }
300621
def autoload
    logger.info("Autoloading registered plugins at #{Time.now}")

    @@environments[@actor_id].autoload do |namespace, plugin_type, provider, plugin|
      logger.debug("Autoloading provider #{provider} at #{plugin[:directory]}")

      # Make sure extensions are listening from the time they are loaded
      if plugin[:namespace] == :nucleon && plugin_type == :extension
        logger.debug("Creating #{plugin_type} #{provider}")

        # Create a persistent instance
        load(plugin[:namespace], :extension, provider, { :name => provider })
      end
    end
  end
1304995
def get_bootstrap(cls, name, ctx):
        '''
        '''
        if name is None:
            return None
        if not hasattr(cls, 'bootstraps'):
            cls.bootstraps = {}
        if name in cls.bootstraps:
            return cls.bootstraps[name]
        mod = importlib.import_module('pythonforandroid.bootstraps.{}'
                                      .format(name))
        if len(logger.handlers) > 1:
            logger.removeHandler(logger.handlers[1])
        bootstrap = mod.bootstrap
        bootstrap.bootstrap_dir = join(ctx.root_dir, 'bootstraps', name)
        bootstrap.ctx = ctx
        return bootstrap
1104385
def _init_pluginmanager(self):
        
        self.pluginmanager = PluginManager(logger=self.logger)
        self.logger.debug("Registering execution wide plugins:")
        self.pluginmanager.load_default_run_plugins()
        self.pluginmanager.load_custom_run_plugins(self.args.plugin_path)
        self.logger.debug("Execution wide plugins loaded and registered.")
149068
def load_default_run_plugins(self):
        
        for plugin_name, plugin_class in default_plugins.items():
            if issubclass(plugin_class, RunPluginBase):
                try:
                    self.register_run_plugins(plugin_name, plugin_class())
                except PluginException as error:
                    self.logger.debug(error)
                    continue
689224
function hookInstanbul(opts) {
  return loadJspmConfig(opts).then(loader => {
    sh.echo('Registering instrumentation hook to loader...');
    systemIstanbul.hookSystemJS(loader, opts.exclude(loader.baseURL));

    return loader;
  });
}
671844
def configure(logger=None):
    
    global LOGGER
    if logger is None:
        LOGGER = logging.basicConfig(stream=sys.stdout, level=logging.INFO)
    else:
        LOGGER = logger
333511
def make_default_logger(name=INTERNAL_LOGGER_NAME, level=logging.INFO,
                        fmt='%(asctime)s - %(name)s - %(levelname)s - %(message)s'):
    """"""
    logger = logging.getLogger(name)
    logger.setLevel(level)
    if not logger.handlers:
        handler = logging.StreamHandler(sys.stderr)
        handler.setLevel(level)
        formatter = logging.Formatter(fmt)
        handler.setFormatter(formatter)
        logger.addHandler(handler)

    return logger
283759
def setup_legacy_graph(native, options_bootstrapper, build_configuration):
    """"""
    bootstrap_options = options_bootstrapper.bootstrap_options.for_global_scope()
    return EngineInitializer.setup_legacy_graph_extended(
      bootstrap_options.pants_ignore,
      bootstrap_options.pants_workdir,
      bootstrap_options.local_store_dir,
      bootstrap_options.build_file_imports,
      options_bootstrapper,
      build_configuration,
      native=native,
      glob_match_error_behavior=bootstrap_options.glob_expansion_failure,
      build_ignore_patterns=bootstrap_options.build_ignore,
      exclude_target_regexps=bootstrap_options.exclude_target_regexp,
      subproject_roots=bootstrap_options.subproject_roots,
      include_trace_on_error=bootstrap_options.print_exception_stacktrace,
      execution_options=ExecutionOptions.from_bootstrap_options(bootstrap_options),
    )
380864
def use_loggly(self, enabled=True,
                   loggly_token=None,
                   loggly_tag=None,
                   level=logging.WARNING,
                   log_format=None,
                   date_format=None):
        
        if enabled:
            if not self.__loggly_handler:
                assert loggly_token, 'Loggly token is missing!'

                # Use logger name for default Loggly tag
                if not loggly_tag:
                    loggly_tag = self.name

                # Create new LogglyHandler instance
                self.__loggly_handler = LogglyHandler(token=loggly_token, tag=loggly_tag)

                # Use this format for default case
                if not log_format:
                    log_format = '{"name":"%(name)s","process":"%(process)d",' \
                                 '"levelname":"%(levelname)s","time":"%(asctime)s",' \
                                 '"filename":"%(filename)s","programname":"%(programname)s",' \
                                 '"module":"%(module)s","funcName":"%(funcName)s",' \
                                 '"lineno":"%(lineno)d","message":"%(message)s"}'

                # Set formatter
                formatter = logging.Formatter(fmt=log_format, datefmt=date_format)
                self.__loggly_handler.setFormatter(fmt=formatter)

                # Set level for this handler
                self.__loggly_handler.setLevel(level=level)

                # Add this handler to logger
                self.add_handler(hdlr=self.__loggly_handler)
        elif self.__loggly_handler:
            # Remove handler from logger
            self.remove_handler(hdlr=self.__loggly_handler)
            self.__loggly_handler = None
898643
def setup_logger(cls):
		
		if WAppsGlobals.log is None:
			WAppsGlobals.log = logging.getLogger("wasp-launcher")
			formatter = logging.Formatter(
				'[%(name)s] [%(threadName)s] [%(levelname)s] [%(asctime)s] %(message)s',
				'%Y-%m-%d %H:%M:%S'
			)
			WLogApp.__log_handler__ = logging.StreamHandler(sys.stdout)
			WLogApp.__log_handler__.setFormatter(formatter)
			WAppsGlobals.log.addHandler(WLogApp.__log_handler__)
			WAppsGlobals.log.setLevel(logging.INFO)
1260010
def setup_logger(logger=None, level='INFO'):
    
    if not logger:  # if no logger exists, make one
        logger = logging.getLogger()

    if not logger.handlers:  # setup logger handlers
        channel = logging.StreamHandler()
        channel.setFormatter(log.DebugLogFormatter())

        # channel.setFormatter(log.LogFormatter())
        logger.setLevel(level)
        logger.addHandler(channel)
545228
def setup_logger(log_dir=None, loglevel=logging.DEBUG):
    

    create_home_dir()
    create_dir(os.path.join(get_default_home_dir(), 'log'))

    if log_dir is None:
        log_dir = os.path.join(get_default_home_dir(), 'log')

    logger = logging.getLogger('ding0') # use filename as name in log
    logger.setLevel(loglevel)

    # create a file handler
    handler = logging.FileHandler(os.path.join(log_dir, 'ding0.log'))
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s-%(funcName)s-%(message)s (%(levelname)s)')
    handler.setFormatter(formatter)

    # create a stream handler (print to prompt)
    stream = logging.StreamHandler()
    stream.setLevel(logging.INFO)
    stream_formatter = logging.Formatter(
        '%(message)s (%(levelname)s)')
    stream.setFormatter(stream_formatter)

    # add the handlers to the logger
    logger.addHandler(handler)
    logger.addHandler(stream)

    logger.info('########## New run of Ding0 issued #############')

    return logger
861769
def logging_stream_install(loglevel):
    
    formatter = logging.Formatter(LOGGING_FORMAT)
    logger = logging.getLogger()

    logger.removeHandler(LOGGING_HANDLERS['stream'])

    if loglevel == LOGGING_LOGNOTHING:
        streamHandler = None
    else:
        streamHandler = logging.StreamHandler()
        streamHandler.setLevel(loglevel)
        streamHandler.setFormatter(formatter)

    LOGGING_HANDLERS['stream'] = streamHandler

    if streamHandler:
        logger.addHandler(streamHandler)
460920
function bootstrap(app, options) {
  var config = defaults({}, options, DEFAULT_CONFIGURATION);
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};

  if (!app._mukoan.initialized) {
    initialize(app, options);
  }

  if (!app._mukoan.bootstrapped) {
    // Configure and setup middlewares
    app.use(middlewares.bodyparser(config.bodyParser));
    app.use(middlewares.morgan(config.morgan.format, config.morgan.options));
    app.use(middlewares.responseTime());
    app.use(middlewares.helmet(config.helmet));
    app.use(middlewares.compress({
      flush: zlib.Z_SYNC_FLUSH
    }));
    app.use(middlewares.conditional());
    app.use(middlewares.etag());
    app.use(middlewares.cacheControl(config.cacheControl));
    app.use(middlewares.cors(config.cors));
    app.use(middlewares.favicon(config.favicon));
    app.use(middlewares.jwt(config.jwt.options).unless(config.jwt.unless));
    app.use(middlewares.json());
    app._mukoan.bootstrapped = true;
    log.debug('Finished configuring Koa server');
  } else {
    log.warn('Trying to bootstrap the same Koa instance twice (ignoring action)');
  }
  return app;
}
768500
def build_logger(
    name=os.getenv(
        "LOG_NAME",
        "client"),
    config="logging.json",
    log_level=logging.INFO,
    log_config_path="{}/logging.json".format(
        os.getenv(
            "LOG_CFG",
            os.path.dirname(os.path.realpath(__file__))))):
    
    use_config = ("./log/{}").format(
                    "{}".format(
                        config))
    if not os.path.exists(use_config):
        use_config = log_config_path
        if not os.path.exists(use_config):
            use_config = ("./antinex_client/log/{}").format(
                            "logging.json")
    # find the log processing

    setup_logging(
        default_level=log_level,
        default_path=use_config)

    return logging.getLogger(name)
722135
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // make the application available and register the class loaders
        $application = $this->getApplication();
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // try to load the profile logger
        if (isset($this->loggers[LoggerUtils::PROFILE])) {
            $this->profileLogger = $this->loggers[LoggerUtils::PROFILE];
            $this->profileLogger->appendThreadContext('timer-factory');
        }
    }