Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
NorthernMan54 committed Nov 30, 2024
1 parent c472a49 commit 320c0f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export class HapClient extends EventEmitter {

debug(msg) {
if (this.debugEnabled) {
this.logger.log(msg);
const error = new Error();
const stackLines = error.stack.split('\n');
const callerInfo = stackLines[2]; // Line 2 contains the caller information
this.logger.log(msg + ' @ ' + callerInfo);
}
}

Expand Down

0 comments on commit 320c0f6

Please sign in to comment.