Skip to content

Commit ea3531d

Browse files
sauravrawCopilot
andauthored
Update api/src/utils/custom-logger.utils.ts
Co-authored-by: Copilot <[email protected]>
1 parent aab5c08 commit ea3531d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/src/utils/custom-logger.utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ const customLogger = async (
4848
if (!fs.existsSync(logFilePath)) {
4949
// If the file does not exist, create it and write an initial log entry
5050
console.info(`Creating new log file at: ${logFilePath}`);
51-
// Add stack trace to debug where this is being called from
52-
console.info(new Error().stack);
53-
51+
// Conditionally log stack trace based on environment
52+
if (process.env.NODE_ENV !== 'production') {
53+
console.info(new Error().stack);
54+
}
5455
await fs.promises.writeFile(logFilePath, 'Log file created\n', {
5556
flag: 'a',
5657
});

0 commit comments

Comments
 (0)