Skip to content

Commit 8ae5c7b

Browse files
committed
improve anonymous function
1 parent 2b22c7d commit 8ae5c7b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/teams-js/src/internal/telemetry.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ const createDebuggerFunction = (namespace: string): Debugger => {
1919

2020
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2121
const func = function (formatter: any, ...args: any[]): void {
22-
if (GlobalVars.turnOnConsoleLog) {
23-
internalDebugger(formatter, args);
24-
console.log(formatter, args);
22+
if (GlobalVars.turnOnConsoleLog && localStorage.getItem('debug') != 'teamsJs.*') {
23+
args.unshift(`color: ${internalDebugger.color}`);
24+
console.log(`${internalDebugger.namespace}: ${formatter}`, args);
2525
}
26+
internalDebugger(formatter, args);
2627
} as Debugger;
2728

2829
Object.assign(func, {

0 commit comments

Comments
 (0)