improve logger

This commit is contained in:
grimhilt
2023-04-02 12:59:11 +02:00
parent 3042ed972b
commit 948ec3c7b4
12 changed files with 66 additions and 40 deletions

View File

@@ -24,7 +24,7 @@ export default class Box {
const readOnly = true;
this.imap.openBox(this.boxName, readOnly, (err, box) => {
if (err) logger.error(err);
if (err) logger.err(err);
this.sync(this.box.uidnext, box.uidnext);
});
}
@@ -48,7 +48,7 @@ export default class Box {
});
f.once("error", (err) => {
logger.error("Fetch error: " + err);
logger.err("Fetch error: " + err);
});
f.once("end", async () => {

View File

@@ -31,7 +31,7 @@ export class ImapInstance {
});
this.imap.once("error", (err) => {
logger.error("Imap error for " + this.account.user + ": " + err);
logger.err("Imap error for " + this.account.user + ": " + err);
});
this.imap.once("end", () => {
@@ -47,7 +47,7 @@ export class ImapInstance {
this.boxes.push(new Box(this.imap, mailboxes[0].mailbox_id, mailboxes[0].mailbox_name));
} else {
this.imap.getBoxes("", (err, boxes) => {
if (err) logger.error(err);
if (err) logger.err(err);
const allBoxName = this.getAllBox(boxes);
registerMailbox(this.account.id, allBoxName).then((mailboxId) => {
this.boxes.push(new Box(this.imap, mailboxId, allBoxName));

View File

@@ -23,7 +23,7 @@ export default class ImapSync {
this.addInstance(accounts[i]);
}
}).catch((err) => {
logger.error(err);
logger.err(err);
});
}

View File

@@ -89,7 +89,7 @@ export default class RegisterMessageInApp {
this.registerMembers(roomId);
return roomId;
} catch (err) {
logger.error(err);
logger.err(err);
}
}