diff --git a/packages/cli/src/commands/server/runServer.js b/packages/cli/src/commands/server/runServer.js index 586fb4274..181d8fd34 100644 --- a/packages/cli/src/commands/server/runServer.js +++ b/packages/cli/src/commands/server/runServer.js @@ -8,16 +8,14 @@ */ import Metro from 'metro'; - import {Terminal} from 'metro-core'; - import morgan from 'morgan'; import path from 'path'; +import {logger} from '@react-native-community/cli-tools'; import type {ConfigT} from '../../tools/config/types.flow'; import messageSocket from './messageSocket'; import webSocketProxy from './webSocketProxy'; import MiddlewareManager from './middleware/MiddlewareManager'; - import loadMetroConfig from '../../tools/loadMetroConfig'; export type Args = {| @@ -62,7 +60,14 @@ async function runServer(argv: Array, ctx: ConfigT, args: Args) { watchFolders: metroConfig.watchFolders, }); - middlewareManager.getConnectInstance().use(morgan('combined')); + middlewareManager.getConnectInstance().use( + morgan( + 'combined', + !logger.isVerbose() && { + skip: (req, res) => res.statusCode < 400, + }, + ), + ); metroConfig.watchFolders.forEach( middlewareManager.serveStatic.bind(middlewareManager),