| 68 | } |
| 69 | |
| 70 | constructor( |
| 71 | public readonly name: string, |
| 72 | public readonly parent: Logger | null = null, |
| 73 | ) { |
| 74 | super(); |
| 75 | |
| 76 | const path: string[] = []; |
| 77 | let p = parent; |
| 78 | while (p) { |
| 79 | path.push(p.name); |
| 80 | p = p.parent; |
| 81 | } |
| 82 | this._metadata = { name, path }; |
| 83 | this._observable = this._subject.asObservable(); |
| 84 | if (this.parent && this.parent._subject) { |
| 85 | // When the parent completes, complete us as well. |
| 86 | this.parent._subject.subscribe(undefined, undefined, () => this.complete()); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | asApi(): LoggerApi { |
| 91 | return { |