Skip to content

Commit

Permalink
fix: Log into console only once when an error log
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiogc9 committed Aug 10, 2023
1 parent d8a794f commit 2c41fab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/providers/Express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Express {
});
Log.info(`Loaded certificate for domain ${domain}`);
} catch (e: any) {
Log.error(`No SSL certificate found for domain ${domain}: ${e instanceof Error ? e.message : e}`);
Log.warn(`No SSL certificate found for domain ${domain}: ${e instanceof Error ? e.message : e}`);
certificate = tls.createSecureContext(tempCertificate);
}

Expand Down
3 changes: 0 additions & 3 deletions packages/utils/src/Log/Log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export class Log {

// Adds ERROR prefix string to the log string
public error(_string: string, options?: LogOptions) {
// Line break and show the first line
console.log('\x1b[31m%s\x1b[0m', `[ERROR] :: ${_string.split(/r?\n/)[0]}`);

this.__addLog('ERROR', _string, options);
}

Expand Down

0 comments on commit 2c41fab

Please sign in to comment.