/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
server
/
dev
/
/opt/canhelp/node_modules/next/dist/esm/server/dev
mkdir
upload
Name
Size
Mode
Actions
browser-logs/
-
0755
rm
dev-indicator-server-state.js
120
0644
edit
dl
rm
dev-indicator-server-state.js.map
369
0644
edit
dl
rm
get-source-map-from-file.js
2883
0644
edit
dl
rm
get-source-map-from-file.js.map
4283
0644
edit
dl
rm
hot-middleware.js
9498
0644
edit
dl
rm
hot-middleware.js.map
14785
0644
edit
dl
rm
hot-reloader-turbopack.js
43223
0644
edit
dl
rm
hot-reloader-turbopack.js.map
66238
0644
edit
dl
rm
hot-reloader-types.js
1363
0644
edit
dl
rm
hot-reloader-types.js.map
5906
0644
edit
dl
rm
hot-reloader-webpack.js
64176
0644
edit
dl
rm
hot-reloader-webpack.js.map
98458
0644
edit
dl
rm
log-requests.js
4297
0644
edit
dl
rm
log-requests.js.map
8495
0644
edit
dl
rm
messages.js
149
0644
edit
dl
rm
messages.js.map
299
0644
edit
dl
rm
middleware-turbopack.js
15455
0644
edit
dl
rm
middleware-turbopack.js.map
25499
0644
edit
dl
rm
middleware-webpack.js
19169
0644
edit
dl
rm
middleware-webpack.js.map
33006
0644
edit
dl
rm
next-dev-server.js
33127
0644
edit
dl
rm
next-dev-server.js.map
57881
0644
edit
dl
rm
node-stack-frames.js
2051
0644
edit
dl
rm
node-stack-frames.js.map
3600
0644
edit
dl
rm
on-demand-entry-handler.js
29735
0644
edit
dl
rm
on-demand-entry-handler.js.map
49991
0644
edit
dl
rm
parse-version-info.js
2013
0644
edit
dl
rm
parse-version-info.js.map
3327
0644
edit
dl
rm
require-cache.js
1145
0644
edit
dl
rm
require-cache.js.map
2069
0644
edit
dl
rm
static-paths-worker.js
3555
0644
edit
dl
rm
static-paths-worker.js.map
7058
0644
edit
dl
rm
turbopack-utils.js
28377
0644
edit
dl
rm
turbopack-utils.js.map
47029
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/server/dev/log-requests.js
(4297B)
import { blue, bold, gray, green, red, white, yellow } from '../../lib/picocolors'; import { stripNextRscUnionQuery } from '../../lib/url'; import { getRequestMeta } from '../request-meta'; /** * Returns true if the incoming request should be ignored for logging. */ export function ignoreLoggingIncomingRequests(request, loggingConfig) { var _loggingConfig_incomingRequests; // If it's boolean use the boolean value if (typeof (loggingConfig == null ? void 0 : loggingConfig.incomingRequests) === 'boolean') { return !loggingConfig.incomingRequests; } // Any of the value on the chain is falsy, will not ignore the request. const ignore = loggingConfig == null ? void 0 : (_loggingConfig_incomingRequests = loggingConfig.incomingRequests) == null ? void 0 : _loggingConfig_incomingRequests.ignore; // If ignore is not set, don't ignore anything if (!ignore) { return false; } // If array of RegExp, ignore if any pattern matches return ignore.some((pattern)=>pattern.test(request.url)); } export function logRequests(options) { const { request, response, loggingConfig, requestDurationInMs } = options; if (!ignoreLoggingIncomingRequests(request, loggingConfig)) { logIncomingRequests({ request, requestDurationInMs, statusCode: response.statusCode }); } if (request.fetchMetrics) { for (const fetchMetric of request.fetchMetrics){ logFetchMetric(fetchMetric, loggingConfig); } } } function logIncomingRequests(options) { const { request, requestDurationInMs, statusCode } = options; const isRSC = getRequestMeta(request, 'isRSCRequest'); const url = isRSC ? stripNextRscUnionQuery(request.url) : request.url; const statusCodeColor = statusCode < 200 ? white : statusCode < 300 ? green : statusCode < 400 ? blue : statusCode < 500 ? yellow : red; const coloredStatus = statusCodeColor(statusCode.toString()); return writeLine(`${request.method} ${url} ${coloredStatus} in ${requestDurationInMs}ms`); } function logFetchMetric(fetchMetric, loggingConfig) { var _loggingConfig_fetches; let { cacheReason, cacheStatus, cacheWarning, end, method, start, status, url } = fetchMetric; if (cacheStatus === 'hmr' && !(loggingConfig == null ? void 0 : (_loggingConfig_fetches = loggingConfig.fetches) == null ? void 0 : _loggingConfig_fetches.hmrRefreshes)) { // Cache hits during HMR refreshes are intentionally not logged, unless // explicitly enabled in the logging config. return; } if (loggingConfig == null ? void 0 : loggingConfig.fetches) { if (url.length > 48 && !loggingConfig.fetches.fullUrl) { url = truncateUrl(url); } writeLine(white(`${method} ${url} ${status} in ${Math.round(end - start)}ms ${formatCacheStatus(cacheStatus)}`), 1); if (cacheStatus === 'skip' || cacheStatus === 'miss') { writeLine(gray(`Cache ${cacheStatus === 'skip' ? 'skipped' : 'missed'} reason: (${white(cacheReason)})`), 2); } } else if (cacheWarning) { // When logging for fetches is not enabled, we still want to print any // associated warnings, so we print the request first to provide context. writeLine(white(`${method} ${url}`), 1); } if (cacheWarning) { writeLine(`${yellow(bold('⚠'))} ${white(cacheWarning)}`, 2); } } function writeLine(text, indentationLevel = 0) { process.stdout.write(` ${'│ '.repeat(indentationLevel)}${text}\n`); } function truncate(text, maxLength) { return maxLength !== undefined && text.length > maxLength ? text.substring(0, maxLength) + '..' : text; } function truncateUrl(url) { const { protocol, host, pathname, search } = new URL(url); return protocol + '//' + truncate(host, 16) + truncate(pathname, 24) + truncate(search, 16); } function formatCacheStatus(cacheStatus) { switch(cacheStatus){ case 'hmr': return green('(HMR cache)'); case 'hit': return green('(cache hit)'); case 'miss': case 'skip': return yellow(`(cache ${cacheStatus})`); default: return cacheStatus; } } //# sourceMappingURL=log-requests.js.map
Save
cmd:
run