Map the logs routes.
772498
private function mapLogsRoutes()
    {
        $this->prefix('logs')->name('logs.')->group(function() {
            $this->get('/', 'LogViewerController@listLogs')
                 ->name('list'); // log-viewer::logs.list

            $this->delete('delete', 'LogViewerController@delete')
                 ->name('delete'); // log-viewer::logs.delete

            $this->prefix('{date}')->group(function() {
                $this->get('/', 'LogViewerController@show')
                     ->name('show'); // log-viewer::logs.show

                $this->get('download', 'LogViewerController@download')
                     ->name('download'); // log-viewer::logs.download

                $this->get('{level}', 'LogViewerController@showByLevel')
                     ->name('filter'); // log-viewer::logs.filter

                $this->get('{level}/search', 'LogViewerController@search')
                     ->name('search'); // log-viewer::logs.search
            });
        });
    }
1232664
public static synchronized void redirectPlatformLoggers() {
        if (loggingEnabled || !LoggingSupport.isAvailable()) return;

        loggingEnabled = true;
        for (Map.Entry<String, WeakReference<PlatformLogger>> entry : loggers.entrySet()) {
            WeakReference<PlatformLogger> ref = entry.getValue();
            PlatformLogger plog = ref.get();
            if (plog != null) {
                plog.redirectToJavaLoggerProxy();
            }
        }
    }
485252
static Map<String, Object> makeLoggingMap(Properties props)
  {
    Map<String, Object> loggingMap = Maps.newHashMap();

    loggingMap.put(
        "loggerClass", props.getProperty("com.metamx.emitter.logging.class", LoggingEmitter.class.getName())
    );
    loggingMap.put(
        "logLevel", props.getProperty("com.metamx.emitter.logging.level", "debug")
    );
    return loggingMap;
  }
1339235
protected function logRouteStart()
    {
        $this->executionStart = microtime(true);
        $message = sprintf("Routing to -> <info>%s#%s</info>", get_class($this->controller), $this->action);

        $logger = Strata::app()->getLogger();
        if ($logger) {
            $logger->logNewContext($message, "<green>Route</green>", "green");
        }
    }
375249
def _init_routes(self):
        """"""
        self.url_map = Map()
        self.url_map.add(Rule('/static/_/<coll>/<path:filepath>', endpoint=self.serve_static))
        self.url_map.add(Rule('/static/<path:filepath>', endpoint=self.serve_static))
        self.url_map.add(Rule('/collinfo.json', endpoint=self.serve_listing))

        if self.is_valid_coll('$root'):
            coll_prefix = ''
        else:
            coll_prefix = '/<coll>'
            self.url_map.add(Rule('/', endpoint=self.serve_home))

        self.url_map.add(Rule(coll_prefix + self.cdx_api_endpoint, endpoint=self.serve_cdx))
        self.url_map.add(Rule(coll_prefix + '/', endpoint=self.serve_coll_page))
        self.url_map.add(Rule(coll_prefix + '/timemap/<timemap_output>/<path:url>', endpoint=self.serve_content))

        if self.recorder_path:
            self.url_map.add(Rule(coll_prefix + self.RECORD_ROUTE + '/<path:url>', endpoint=self.serve_record))

        if self.proxy_prefix is not None:
            # Add the proxy-fetch endpoint to enable PreservationWorker to make CORS fetches worry free in proxy mode
            self.url_map.add(Rule('/proxy-fetch/<path:url>', endpoint=self.proxy_fetch,
                                  methods=['GET', 'HEAD', 'OPTIONS']))
        self.url_map.add(Rule(coll_prefix + '/<path:url>', endpoint=self.serve_content))
528931
def update_log_filenames(self):
        """"""
        log_filenames = os.listdir(self.logs_dir)

        for log_filename in log_filenames:
            full_path = os.path.join(self.logs_dir, log_filename)
            if full_path not in self.log_filenames:
                self.log_filenames.add(full_path)
                self.closed_file_infos.append(
                    LogFileInfo(
                        filename=full_path,
                        size_when_last_opened=0,
                        file_position=0,
                        file_handle=None))
                logger.info("Beginning to track file {}".format(log_filename))
896596
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {
            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('menus', 'AdminController@index')->name('admin::index-menus')->middleware('can:see-all-menus');
                $router->get('menus/create', 'AdminController@create')->name('admin::create-menu')->middleware('can:create-menu');
                $router->get('menus/{menu}/edit', 'AdminController@edit')->name('admin::edit-menu')->middleware('can:update-menu');
                $router->post('menus', 'AdminController@store')->name('admin::store-menu')->middleware('can:create-menu');
                $router->put('menus/{menu}', 'AdminController@update')->name('admin::update-menu')->middleware('can:update-menu');

                $router->get('menus/{menu}/menulinks/create', 'MenulinksAdminController@create')->name('admin::create-menulink')->middleware('can:create-menu');
                $router->get('menus/{menu}/menulinks/{menulink}/edit', 'MenulinksAdminController@edit')->name('admin::edit-menulink')->middleware('can:update-menu');
                $router->post('menus/{menu}/menulinks', 'MenulinksAdminController@store')->name('admin::store-menulink')->middleware('can:create-menu');
                $router->put('menus/{menu}/menulinks/{menulink}', 'MenulinksAdminController@update')->name('admin::update-menulink')->middleware('can:update-menu');
            });

            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('menus', 'ApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}', 'ApiController@updatePartial')->middleware('can:update-menu');
                    $router->delete('menus/{menu}', 'ApiController@destroy')->middleware('can:delete-menu');

                    $router->get('menus/{menu}/menulinks', 'MenulinksApiController@index')->middleware('can:see-all-menus');
                    $router->patch('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@updatePartial')->middleware('can:update-menu');
                    $router->post('menus/{menu}/menulinks/sort', 'MenulinksApiController@sort')->middleware('can:update-menu');
                    $router->delete('menus/{menu}/menulinks/{menulink}', 'MenulinksApiController@destroy')->middleware('can:delete-menu');
                });
            });
        });
    }
1277066
def _routes(self, app):
        
        _routes = []
        prefix = self.url_prefix if self.url_prefix is not None else ""
        for rule in app.url_map.iter_rules():
            if str(rule).startswith(prefix):
                _routes.append({
                    'path':rule.rule,
                    'name':rule.endpoint,
                    'methods':list(rule.methods)
                })
        returns = {
            'api': self.name,
            'url_root': request.url_root,
            'routes': _routes
        }
        return jsonify(returns)
906609
protected function mapWebRoutes()
    {
        Route::group([
            'middleware' => ['soda.web'],
            'namespace'  => $this->namespace,
        ], function ($router) {
            require __DIR__.'/../../routes/web.php';
        });

        $this->app['router']->getRoutes()->refreshNameLookups();

        $this->app['events']->fire('soda.routing', $this->app->router);
    }
968928
public function map()
    {
        $appPath = __DIR__ . DIRECTORY_SEPARATOR;
        $path = $appPath . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "routes" . DIRECTORY_SEPARATOR;

        $this->mapApiRoutes($path);

        $this->mapWebRoutes($path);

        //
    }
1131607
private synchronized void buildMaps() {
    if (loggedTaskMap == null) {
      loggedTaskMap = new HashMap<TaskID, LoggedTask>();
      loggedTaskAttemptMap = new HashMap<TaskAttemptID, LoggedTaskAttempt>();
      
      for (LoggedTask map : job.getMapTasks()) {
        map = sanitizeLoggedTask(map);
        if (map != null) {
          loggedTaskMap.put(maskTaskID(TaskID.forName(map.taskID)), map);

          for (LoggedTaskAttempt mapAttempt : map.getAttempts()) {
            mapAttempt = sanitizeLoggedTaskAttempt(mapAttempt);
            if (mapAttempt != null) {
              TaskAttemptID id = TaskAttemptID.forName(mapAttempt
                  .getAttemptID());
              loggedTaskAttemptMap.put(maskAttemptID(id), mapAttempt);
            }
          }
        }
      }
      for (LoggedTask reduce : job.getReduceTasks()) {
        reduce = sanitizeLoggedTask(reduce);
        if (reduce != null) {
          loggedTaskMap.put(maskTaskID(TaskID.forName(reduce.taskID)), reduce);

          for (LoggedTaskAttempt reduceAttempt : reduce.getAttempts()) {
            reduceAttempt = sanitizeLoggedTaskAttempt(reduceAttempt);
            if (reduceAttempt != null) {
              TaskAttemptID id = TaskAttemptID.forName(reduceAttempt
                  .getAttemptID());
              loggedTaskAttemptMap.put(maskAttemptID(id), reduceAttempt);
            }
          }
        }
      }

      // TODO: do not care about "other" tasks, "setup" or "clean"
    }
  }
1049222
def format_runlog(runlog: List[Mapping[str, Any]]) -> str:
    
    to_ret = []
    for command in runlog:
        to_ret.append(
            '\t' * command['level']
            + command['payload'].get('text', '').format(**command['payload']))
        if command['logs']:
            to_ret.append('\t' * command['level'] + 'Logs from this command:')
            to_ret.extend(
                ['\t' * command['level']
                 + f'{l.levelname} ({l.module}): {l.msg}' % l.args
                 for l in command['logs']])
    return '\n'.join(to_ret)
713849
def app_routes(app):
    
    _routes = []
    for rule in app.url_map.iter_rules():
        _routes.append({
            'path': rule.rule,
            'name': rule.endpoint,
            'methods': list(rule.methods)
        })
    return jsonify({'routes': _routes})
566489
public function map() {
		$modules = Module::all();
		
		//dd($modules);
		
		foreach ($modules as $module) {
			$routes = $module->routes;
			$routesFolder = 'routes'.DIRECTORY_SEPARATOR;
			
			if ($routes) {
				foreach ($routes as $route) {
					if (strrpos($route, $routesFolder."web")) {
						
						$this->mapWebRoute($route, $module->namespace);
					}
					elseif (strrpos($route, $routesFolder."api")) {
						
						$this->mapApiRoute($route, $module->namespace);
					}
				}
			}
		}
	}
560396
public function map($route, $handler)
    {
        $this->_routes[] = ['/'.$route, $handler];

        if ($handler) {
            $this->_handlers[$handler][] = '/'.$route;
        }
    }
536052
public function actionLogs()
    {
        $searchModel = new LogSearch();
        return $this->render('logs', [
            'dataProvider' => $searchModel->search(Yii::$app->request->get()),
            'searchModel' => $searchModel,
        ]);
    }
1101886
function router(sessions, nonObjTemplatelogLevel, controllers, req, res, next) {

    if (req.originalUrl.match(/amorphic\/xhr\?path\=/)) {
        if (req.body.type === 'logging') {
            processLoggingMessage(req, res);
        }
        else {
            processMessage(req, res, sessions, nonObjTemplatelogLevel, controllers);
        }
    }
    else {
        next();
    }
}