standardize log statements

This commit is contained in:
Alex Holliday committed 2024-10-24 15:28:13 +08:00
1 parent 6984eb8a70
commit a0248c81c2
12 files changed
+167 -115

No files matched your search

+13 -7
View File
@@ -44,9 +44,11 @@ class EmailService {
const templateContent = this.fs.readFileSync(templatePath, "utf8");
return this.compile(templateContent);
} catch (error) {
this.logger.error("Error loading Email templates", {
error,
service: this.SERVICE_NAME,
this.logger.error({
message: error.message,
service: SERVICE_NAME,
method: "loadTemplate",
stack: error.stack,
});
}
};
@@ -102,9 +104,11 @@ class EmailService {
const html = await this.mjml2html(mjml);
return html.html;
} catch (error) {
this.logger.error("Error building Email HTML", {
error,
this.logger.error({
message: error.message,
service: SERVICE_NAME,
method: "buildAndSendEmail",
stack: error.stack,
});
}
};
@@ -118,9 +122,11 @@ class EmailService {
});
return info;
} catch (error) {
this.logger.error("Error sending Email", {
error,
this.logger.error({
message: error.message,
service: SERVICE_NAME,
method: "sendEmail",
stack: error.stack,
});
}
};