Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit c39e984

Browse files
committed
chore: added error logging to debug issues
1 parent b3ed856 commit c39e984

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

helpers/logger.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (env.SLACK_API_TOKEN) {
5151
axe.setCallback(async (level, message, meta) => {
5252
try {
5353
// if meta did not have `slack: true` or not a specific level
54-
if (!meta.slack && level !== 'fatal') return;
54+
if (!meta.slack && !['error', 'fatal'].includes(level)) return;
5555

5656
// otherwise post a message to the slack channel
5757
const fields = [
@@ -91,6 +91,13 @@ if (env.SLACK_API_TOKEN) {
9191
short: true
9292
});
9393

94+
if (meta.session)
95+
fields.push({
96+
title: 'Session',
97+
value: safeStringify(meta.session),
98+
short: true
99+
});
100+
94101
const result = await web.chat.postMessage({
95102
channel: 'logs',
96103
username: 'Cabin',

0 commit comments

Comments
 (0)