@asciidoctor/core 4.0.0-alpha.1 → 4.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,16 @@
1
+
2
+ /**
3
+ * Run fn() within an async-local logger context so that all log calls via
4
+ * `this.logger` (from applyLogging) automatically route to the provided logger
5
+ * for the duration of the async execution chain.
6
+ *
7
+ * Falls back to global mutation in environments without node:async_hooks (e.g. browsers).
8
+ *
9
+ * @param {Logger|MemoryLogger|NullLogger} logger - The logger to activate.
10
+ * @param {() => any} fn - The function to execute within the logger context.
11
+ * @returns {Promise<any>}
12
+ */
13
+ export function withLogger(logger: Logger | MemoryLogger | NullLogger, fn: () => any): Promise<any>;
1
14
  /**
2
15
  * Apply the Logging mixin to a class prototype.
3
16
  *
@@ -120,12 +133,10 @@ export class MemoryLogger {
120
133
  empty(): boolean;
121
134
  }
122
135
  /** Logger that discards all messages but still tracks the maximum severity. */
123
- export class NullLogger {
136
+ export class NullLogger extends Logger {
124
137
  static create(): NullLogger;
138
+ constructor();
125
139
  level: number;
126
- _maxSeverity: number;
127
- get maxSeverity(): number;
128
- getMaxSeverity(): number;
129
140
  add(severity: any): boolean;
130
141
  log(severity: any): boolean;
131
142
  debug(): boolean;