add logWithDevice method
This commit is contained in:
@@ -60,6 +60,10 @@ function log(message) {
|
|||||||
appointmentLogger.log({level: "info", message: message})
|
appointmentLogger.log({level: "info", message: message})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logWithDevice(message, device) {
|
||||||
|
appointmentLogger.log({level: "info", device: device.model(), message: message})
|
||||||
|
}
|
||||||
|
|
||||||
class CommandorPage {
|
class CommandorPage {
|
||||||
constructor(contact, device, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false) {
|
constructor(contact, device, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false) {
|
||||||
this.contact = contact;
|
this.contact = contact;
|
||||||
@@ -374,7 +378,10 @@ class CommandorPage {
|
|||||||
shell.beep()
|
shell.beep()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("发现datadome");
|
logWithDevice("发现datadome", this.device);
|
||||||
|
} else if (content.includes("502 Bad Gateway")) {
|
||||||
|
logWithDevice("502 Bad Gateway found", this.device)
|
||||||
|
await this.page.reload()
|
||||||
} else if (currentPage.url().includes("sorry")) {
|
} else if (currentPage.url().includes("sorry")) {
|
||||||
await this.resetBrowser()
|
await this.resetBrowser()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user