How to use the @react-native-community/cli-tools.logger.isVerbose function in @react-native-community/cli-tools

To help you get started, we’ve selected a few @react-native-community/cli-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-native-community / cli / packages / cli / src / tools / loader.ts View on Github external
export function getLoader() {
  // FIXME refactor getLoader to not rely on class instantiation to avoid type conflict or implement an default Ora Loader Class definition
  return logger.isVerbose() ? OraNoop : (ora as any);
}
github react-native-community / cli / packages / cli / src / commands / server / runServer.ts View on Github external
metroConfig.transformer.assetPlugins = args.assetPlugins.map(plugin =>
      require.resolve(plugin),
    );
  }

  const middlewareManager = new MiddlewareManager({
    host: args.host,
    port: metroConfig.server.port,
    watchFolders: metroConfig.watchFolders,
  });

  middlewareManager.getConnectInstance().use(
    // @ts-ignore morgan and connect types mismatch
    morgan(
      'combined',
      !logger.isVerbose()
        ? {
            skip: (_req, res) => res.statusCode < 400,
          }
        : undefined,
    ),
  );

  metroConfig.watchFolders.forEach(
    middlewareManager.serveStatic.bind(middlewareManager),
  );

  const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;

  metroConfig.server.enhanceMiddleware = (middleware: any, server: unknown) => {
    if (customEnhanceMiddleware) {
      middleware = customEnhanceMiddleware(middleware, server);
github react-native-community / cli / packages / platform-ios / src / commands / runIOS / index.ts View on Github external
buildProcess.stdout.on('data', (data: Buffer) => {
      const stringData = data.toString();
      buildOutput += stringData;
      if (xcpretty) {
        xcpretty.stdin.write(data);
      } else {
        if (logger.isVerbose()) {
          logger.debug(stringData);
        } else {
          process.stdout.write('.');
        }
      }
    });
    buildProcess.stderr.on('data', (data: Buffer) => {
github react-native-community / cli / packages / cli / src / tools / packageManager.ts View on Github external
function executeCommand(
  command: string,
  args: Array,
  options: Options,
) {
  return execa(command, args, {
    stdio: options.silent && !logger.isVerbose() ? 'pipe' : 'inherit',
    cwd: options.root,
  });
}