Skip to content

Commit

Permalink
fix(server): handle the cases that res cannot be writable
Browse files Browse the repository at this point in the history
  • Loading branch information
yimingjfe committed Oct 24, 2024
1 parent 2b890bc commit 8021750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions packages/server/prod-server/src/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ import { createLogger, isProd } from '@modern-js/utils';
import type { ProdServerOptions } from './types';

function getLogger() {
if (
process.env.DEBUG ||
(process.env.NODE_ENV === 'production' && !process.env.DISABLE_LOG)
) {
return createLogger({ level: 'verbose' });
if (process.env.DEBUG || process.env.NODE_ENV === 'production') {
return createLogger({
level: (process.env.MODERN_SERVER_LOG_LEVEL as any) || 'verbose',
});
} else {
return createLogger();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"test:rspack": "pnpm test:builder:rspack && pnpm test:framework && pnpm test:garfish:rspack",
"test:framework": "DISABLE_LOG=true jest",
"test:framework": "MODERN_SERVER_LOG_LEVEL=info jest",
"test:builder:rspack": "cd e2e/builder && pnpm test:rspack",
"test:garfish:rspack": "cd e2e/garfish && pnpm test:rspack",
"test:module-tools": "cd integration && jest --testMatch **/module/**/*.test.ts",
Expand Down

0 comments on commit 8021750

Please sign in to comment.