Skip to content

Commit db0a481

Browse files
itsdougestriplex-bot
authored andcommitted
Add logging and tracing integrations to aid in debugging
adeira-source-id: 030ed16
1 parent 1e42914 commit db0a481

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

.changeset/nice-donkeys-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@triplex/server": patch
3+
---
4+
5+
Add logging around APIs / messages.

.changeset/old-days-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@triplex/websocks-server": patch
3+
---
4+
5+
Add `UNSAFE_use` api that is called for every message recieved.

.changeset/tricky-numbers-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"triplex-vsce": patch
3+
---
4+
5+
Sentry integrations have been turned on to hopefully provide more insight into call stack exceptions.

packages/lib/src/log.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
* This repository utilizes multiple licenses across different directories. To
55
* see this files license find the nearest LICENSE file up the source tree.
66
*/
7+
/* eslint-disable no-console */
78

89
export function createForkLogger(scope: string) {
910
return {
1011
debug: (...msg: string[]) => {
12+
console.debug(`[${scope}]`, ...msg);
1113
process.send?.({
1214
log: {
1315
message: msg,
@@ -17,6 +19,7 @@ export function createForkLogger(scope: string) {
1719
});
1820
},
1921
error: (...msg: string[]) => {
22+
console.error(`[${scope}]`, ...msg);
2023
process.send?.({
2124
log: {
2225
message: msg,
@@ -26,6 +29,7 @@ export function createForkLogger(scope: string) {
2629
});
2730
},
2831
info: (...msg: string[]) => {
32+
console.info(`[${scope}]`, ...msg);
2933
process.send?.({
3034
log: {
3135
message: msg,

0 commit comments

Comments
 (0)