Skip to content

Commit 6f312f3

Browse files
committed
wip
1 parent abf86c1 commit 6f312f3

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

packages/signals/signals/src/core/signals/signals.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,14 @@ export class Signals implements ISignals {
139139
/**
140140
* Log signals to the console.
141141
*/
142-
enableDebugLogging(): void {
143-
logger.enableDebugLogging()
142+
enableDebugLogging({ signalsOnly } = { signalsOnly: true }): void {
143+
if (signalsOnly) {
144+
this.signalEmitter.subscribe((signal) => {
145+
logger.log(signal.type, signal.data)
146+
})
147+
} else {
148+
logger.enableDebugLogging()
149+
}
144150
}
145151

146152
/**

packages/signals/signals/src/lib/logger/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class Logger {
4141
this.setDebugKey(Logger.loggingKey, bool)
4242
}
4343

44+
log = (...args: any[]): void => {
45+
console.log('[signals]', ...args)
46+
}
47+
4448
debug = (...args: any[]): void => {
4549
if (this.debugLoggingEnabled()) {
4650
console.log('[signals debug]', ...args)

packages/signals/signals/src/plugin/signals-plugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,10 @@ export class SignalsPlugin implements Plugin, SignalsAugmentedFunctionality {
9292
debug() {
9393
this.signals.debug()
9494
}
95+
96+
enableDebugLogging(
97+
...args: Parameters<typeof this.signals.enableDebugLogging>
98+
) {
99+
this.signals.enableDebugLogging(...args)
100+
}
95101
}

0 commit comments

Comments
 (0)