logs: escape and unescape new lines
This commit is contained in:
@@ -1377,7 +1377,8 @@ async function appendLogLine(app, line) {
|
||||
const logFilePath = path.join(paths.LOG_DIR, app.id, 'app.log');
|
||||
const isoDate = new Date(new Date().toUTCString()).toISOString();
|
||||
|
||||
if (!safe.fs.appendFileSync(logFilePath, `${isoDate} ${line}\n`)) console.error(`Could not append log line for app ${app.id} at ${logFilePath}: ${safe.error.message}`);
|
||||
const escaped = line.replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
|
||||
if (!safe.fs.appendFileSync(logFilePath, `${isoDate} ${escaped}\n`)) console.error(`Could not append log line for app ${app.id} at ${logFilePath}: ${safe.error.message}`);
|
||||
}
|
||||
|
||||
async function checkManifest(manifest) {
|
||||
|
||||
Reference in New Issue
Block a user