Improve get child behavior
This commit is contained in:
26
src/test.ts
26
src/test.ts
@ -49,5 +49,31 @@ Logging.warning("This should not be there 4");
|
||||
Logging.error("This should be there 1");
|
||||
Logging.errorMessage("This should be there 2");
|
||||
|
||||
const c1 = Logging.getChild("child-level-1");
|
||||
|
||||
c1.log("Hello from Child 1");
|
||||
|
||||
const c2 = c1.getChild("child-level-2");
|
||||
|
||||
c2.log("Hello from Child 2");
|
||||
|
||||
c2.addAdapter({
|
||||
init: (obs) =>
|
||||
obs.subscribe((msg) =>
|
||||
console.log(
|
||||
"Adapter adden on child level 2: ",
|
||||
"---",
|
||||
msg.name,
|
||||
msg.text.raw
|
||||
)
|
||||
),
|
||||
flush: () => undefined,
|
||||
close: () => undefined,
|
||||
});
|
||||
|
||||
c2.log("MSG from C2");
|
||||
c1.log("MSG from C1");
|
||||
Logging.log("MSG from root");
|
||||
|
||||
const timer = Logging.time("timer1", "Test Timer");
|
||||
setTimeout(() => timer.end(), 1000);
|
||||
|
Reference in New Issue
Block a user