mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(logger): add debug logging for matched routes (#19287)
This commit is contained in:
@@ -9,6 +9,7 @@ import index from '@/routes/index';
|
||||
import healthz from '@/routes/healthz';
|
||||
import robotstxt from '@/routes/robots.txt';
|
||||
import metrics from '@/routes/metrics';
|
||||
import logger from '@/utils/logger';
|
||||
|
||||
const __dirname = import.meta.dirname;
|
||||
|
||||
@@ -157,6 +158,7 @@ for (const namespace in namespaces) {
|
||||
|
||||
for (const [path, routeData] of sortedRoutes) {
|
||||
const wrappedHandler: Handler = async (ctx) => {
|
||||
logger.debug(`Matched route: ${ctx.req.routePath}`);
|
||||
if (!ctx.get('data')) {
|
||||
if (typeof routeData.handler !== 'function') {
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
|
||||
Reference in New Issue
Block a user