Skip to content

Commit

Permalink
feat: add logger.nl
Browse files Browse the repository at this point in the history
  • Loading branch information
leegeunhyeok committed Oct 23, 2023
1 parent de388d1 commit 82ac30e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/lib/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const start: Command = async (argv) => {
) {
logger.info(`> press 'r' to reload`);
logger.info(`> press 'd' to open developer menu`);
process.stdout.write('\n');
logger.nl();
}
});
};
1 change: 1 addition & 0 deletions packages/core/lib/bundler/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const loadConfig = (configFilePath?: string): Config => {
*/
logger.warn('could not resolve configuration file');
logger.debug('configuration load error', error as Error);
logger.nl();
}

config = config
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server/lib/server/ReactNativeAppServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class ReactNativeAppServer extends DevServer {
return this.server.listen(port, () => {
this.setupWebSocketServers();
logger.info(`dev server listening on http://${host}:${port}`);
process.stdout.write('\n');
logger.nl();
onListen?.();
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server/lib/server/ReactNativeWebServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class ReactNativeWebServer extends DevServer {
server.listen(port, () => {
logger.info(`dev server listening on http://${host}:${port}`);
logger.debug(`proxy to esbuild ${serveResult.host}:${serveResult.port}`);
process.stdout.write('\n');
logger.nl();
onListen?.();
});

Expand Down
4 changes: 4 additions & 0 deletions packages/utils/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export class Logger {
this.logLevel = level;
}

public nl(): void {
process.stdout.write('\n');
}

public trace(message: string, extra?: object): void {
if (this.getLogLevel() > LogLevel.Trace) return;

Expand Down

2 comments on commit 82ac30e

@vercel
Copy link

@vercel vercel bot commented on 82ac30e Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🔴 Statements 15.86% 359/2263
🔴 Branches 18.17% 137/754
🔴 Functions 10.88% 69/634
🔴 Lines 15.18% 316/2082

Test suite run success

83 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 82ac30e

Please sign in to comment.