specify log file path
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const {createLogger, format, transports} = require('winston');
|
||||
const {_, formatDate} = require('../workers/mongo_manager')
|
||||
const path = require("path");
|
||||
const {printf, label, timestamp, combine} = format;
|
||||
const homedir = require('os').homedir();
|
||||
|
||||
const myFormat = printf(({level, message, label, timestamp}) => {
|
||||
return `${timestamp} [${label}] ${level}: ${message}`;
|
||||
@@ -14,7 +16,7 @@ const appointmentLogger = createLogger({
|
||||
myFormat
|
||||
),
|
||||
transports: [
|
||||
new transports.File({filename: "appointment_" + formatDate(new Date()) + ".log"}),
|
||||
new transports.File({filename: path.join(homedir, "appointment_" + formatDate(new Date()) + ".log")}),
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ class CommandorPage {
|
||||
document.getElementsByClassName("btn")[0].click();
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,10 +297,10 @@ class CommandorPage {
|
||||
await this.checkAudioBtn();
|
||||
for (let i = 0; i < 15; i++) {
|
||||
await delay(1000)
|
||||
console.log("will call beep")
|
||||
log("will call beep")
|
||||
shell.beep()
|
||||
}
|
||||
console.log("发现datadome");
|
||||
log("发现datadome");
|
||||
} else {
|
||||
if (currentPage.url() === RDV_URL) {
|
||||
await this.fillFields(this.page);
|
||||
@@ -308,7 +308,7 @@ class CommandorPage {
|
||||
await this.getErrors()
|
||||
} else {
|
||||
if (content.includes(MESSAGE_URL_VALIDATION_FR) || content.includes(MESSAGE_URL_VALIDATION_EN)) {
|
||||
console.log("successful");
|
||||
log("successful");
|
||||
await this.push_message_to_queue(PublishType.SUCCESS);
|
||||
} else {
|
||||
// try to get errors
|
||||
@@ -317,7 +317,7 @@ class CommandorPage {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
log(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user