Skip to content

Commit

Permalink
fix: move log file to logs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Aug 14, 2024
1 parent 45dd6cd commit 52e9b58
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion helpers/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ const fs = require('fs');
const path = require('path');

module.exports = function logToFile(message) {
const logFilePath = path.join(output_dir, 'codeceptjs-reportportal.log');
const logsDirPath = path.resolve(output_dir, 'logs');

const logFilePath = path.join(logsDirPath, 'codeceptjs-reportportal.log');

if (!fs.existsSync(logsDirPath)) {
fs.mkdirSync(logsDirPath, { recursive: true });
}

const timestamp = new Date().toISOString();
const logMessage = `[${timestamp}] ${message}\n`;

Expand Down

0 comments on commit 52e9b58

Please sign in to comment.