From 320c0f6352c7f9bd4dcd7d4ccabf2ea593828cab Mon Sep 17 00:00:00 2001 From: Northern Man <19808920+NorthernMan54@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:14:06 -0500 Subject: [PATCH] Update index.ts --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ebaebb7..e9b65fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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); } }