Skip to content

Commit 5b3a6a7

Browse files
authored
Merge branch 'main' into ACT-70-improve-controller-hierarchy-tooling
2 parents 41786ec + 9bdc6b7 commit 5b3a6a7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/controller/ApplicationController.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class ApplicationController<
5656
state: State & { _tempObservable: any };
5757
cancelTokens: Record<string, any>;
5858
proxiedThis: any;
59+
_debug = Debug(`controller:${this.constructor.name}`);
5960

6061
constructor() {
6162
this.id = randomId();
@@ -281,6 +282,16 @@ class ApplicationController<
281282
Object.defineProperty(this.prototype, key, descriptor);
282283
});
283284
}
285+
286+
/**
287+
* Output to debugger with the controller name. Set localStorage.debug to
288+
* 'controller:*' or 'controller:MyController' to see debug output.
289+
*
290+
* @param args messages to log
291+
*/
292+
debug(...args: any[]) {
293+
this._debug(...args);
294+
}
284295
}
285296

286297
/**

0 commit comments

Comments
 (0)