Skip to content

Commit

Permalink
Remove emojis from log (#7461)
Browse files Browse the repository at this point in the history
* Remove emojis from log output

* ..
  • Loading branch information
ardatan authored Aug 5, 2024
1 parent 6f3d6f6 commit 4d1eb28
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-pugs-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/utils': patch
---

Replace emojis with prefixes like \`ERR\`, \`DEBUG\`, \`INFO\` and \`WARN\`
2 changes: 1 addition & 1 deletion packages/compose-cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function run({
if (process.env.NODE_ENV === 'test') program = program.allowUnknownOption();
const opts = program.parse().opts();

const log = rootLog.child(`🕸️ ${productName}`);
const log = rootLog.child(` ${productName}`);

let importedConfig: MeshComposeCLIConfig;
if (!opts.configPath) {
Expand Down
8 changes: 4 additions & 4 deletions packages/legacy/utils/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class DefaultLogger implements Logger {
const message = this.getLoggerMessage({
args,
});
const fullMessage = `[${getTimestamp()}] ${this.prefix} ⚠️ ${warnColor(message)}`;
const fullMessage = `[${getTimestamp()}] ${this.prefix} WARN ${warnColor(message)}`;
if (process?.stderr?.write(fullMessage + '\n')) {
return;
}
Expand All @@ -127,7 +127,7 @@ export class DefaultLogger implements Logger {
const message = this.getLoggerMessage({
args,
});
const fullMessage = `[${getTimestamp()}] ${this.prefix} 💡 ${infoColor(message)}`;
const fullMessage = `[${getTimestamp()}] INFO ${this.prefix} ${infoColor(message)}`;
if (typeof process?.stderr?.write === 'function') {
process.stderr.write(fullMessage + '\n');
return;
Expand All @@ -143,7 +143,7 @@ export class DefaultLogger implements Logger {
args,
trim: false,
});
const fullMessage = `[${getTimestamp()}] ${this.prefix} 💥 ${errorColor(message)}`;
const fullMessage = `[${getTimestamp()}] ERROR ${this.prefix} ${errorColor(message)}`;
if (typeof process?.stderr?.write === 'function') {
process.stderr.write(fullMessage + '\n');
return;
Expand All @@ -159,7 +159,7 @@ export class DefaultLogger implements Logger {
const message = this.handleLazyMessage({
lazyArgs,
});
const fullMessage = `[${getTimestamp()}] ${this.prefix} 🐛 ${debugColor(message)}`;
const fullMessage = `[${getTimestamp()}] DEBUG ${this.prefix} ${debugColor(message)}`;
if (typeof process?.stderr?.write === 'function') {
process.stderr.write(fullMessage + '\n');
return;
Expand Down
4 changes: 2 additions & 2 deletions packages/serve-cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface RunOptions extends ReturnType<typeof program.opts> {

export async function run({
log: rootLog = new DefaultLogger(),
productName = 'Mesh',
productName = 'Mesh Serve',
productDescription = 'serve GraphQL federated architecture for any API service(s)',
binName = 'mesh-serve',
version = globalThis.__VERSION__,
Expand All @@ -108,7 +108,7 @@ export async function run({
const opts = program.parse().opts();

const log = rootLog.child(
cluster.worker?.id ? `🕸️ ${productName} Worker#${cluster.worker.id}` : `🕸️ ${productName}`,
cluster.worker?.id ? `${productName} Worker#${cluster.worker.id}` : productName,
);

let importedConfig: MeshServeCLIConfig;
Expand Down

0 comments on commit 4d1eb28

Please sign in to comment.