@depup/globalart__nestjs-logger 2.3.0-depup.0

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.
@@ -0,0 +1,537 @@
1
+ /// <reference path="operators/index.d.ts" />
2
+ /// <reference path="testing/index.d.ts" />
3
+ import * as _nestjs_common0 from "@nestjs/common";
4
+ import { CallHandler, DynamicModule, ExecutionContext, LoggerService as LoggerService$1, MiddlewareConsumer, NestInterceptor, NestModule, RequestMethod } from "@nestjs/common";
5
+ import { Reflector } from "@nestjs/core";
6
+ import { ClsService } from "nestjs-cls";
7
+
8
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscription.d.ts
9
+ /**
10
+ * Represents a disposable resource, such as the execution of an Observable. A
11
+ * Subscription has one important method, `unsubscribe`, that takes no argument
12
+ * and just disposes the resource held by the subscription.
13
+ *
14
+ * Additionally, subscriptions may be grouped together through the `add()`
15
+ * method, which will attach a child Subscription to the current Subscription.
16
+ * When a Subscription is unsubscribed, all its children (and its grandchildren)
17
+ * will be unsubscribed as well.
18
+ */
19
+ declare class Subscription implements SubscriptionLike {
20
+ private initialTeardown?;
21
+ static EMPTY: Subscription;
22
+ /**
23
+ * A flag to indicate whether this Subscription has already been unsubscribed.
24
+ */
25
+ closed: boolean;
26
+ private _parentage;
27
+ /**
28
+ * The list of registered finalizers to execute upon unsubscription. Adding and removing from this
29
+ * list occurs in the {@link #add} and {@link #remove} methods.
30
+ */
31
+ private _finalizers;
32
+ /**
33
+ * @param initialTeardown A function executed first as part of the finalization
34
+ * process that is kicked off when {@link #unsubscribe} is called.
35
+ */
36
+ constructor(initialTeardown?: (() => void) | undefined);
37
+ /**
38
+ * Disposes the resources held by the subscription. May, for instance, cancel
39
+ * an ongoing Observable execution or cancel any other type of work that
40
+ * started when the Subscription was created.
41
+ */
42
+ unsubscribe(): void;
43
+ /**
44
+ * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called
45
+ * when this subscription is unsubscribed. If this subscription is already {@link #closed},
46
+ * because it has already been unsubscribed, then whatever finalizer is passed to it
47
+ * will automatically be executed (unless the finalizer itself is also a closed subscription).
48
+ *
49
+ * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed
50
+ * subscription to a any subscription will result in no operation. (A noop).
51
+ *
52
+ * Adding a subscription to itself, or adding `null` or `undefined` will not perform any
53
+ * operation at all. (A noop).
54
+ *
55
+ * `Subscription` instances that are added to this instance will automatically remove themselves
56
+ * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove
57
+ * will need to be removed manually with {@link #remove}
58
+ *
59
+ * @param teardown The finalization logic to add to this subscription.
60
+ */
61
+ add(teardown: TeardownLogic): void;
62
+ /**
63
+ * Checks to see if a this subscription already has a particular parent.
64
+ * This will signal that this subscription has already been added to the parent in question.
65
+ * @param parent the parent to check for
66
+ */
67
+ private _hasParent;
68
+ /**
69
+ * Adds a parent to this subscription so it can be removed from the parent if it
70
+ * unsubscribes on it's own.
71
+ *
72
+ * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.
73
+ * @param parent The parent subscription to add
74
+ */
75
+ private _addParent;
76
+ /**
77
+ * Called on a child when it is removed via {@link #remove}.
78
+ * @param parent The parent to remove
79
+ */
80
+ private _removeParent;
81
+ /**
82
+ * Removes a finalizer from this subscription that was previously added with the {@link #add} method.
83
+ *
84
+ * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves
85
+ * from every other `Subscription` they have been added to. This means that using the `remove` method
86
+ * is not a common thing and should be used thoughtfully.
87
+ *
88
+ * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance
89
+ * more than once, you will need to call `remove` the same number of times to remove all instances.
90
+ *
91
+ * All finalizer instances are removed to free up memory upon unsubscription.
92
+ *
93
+ * @param teardown The finalizer to remove from this subscription
94
+ */
95
+ remove(teardown: Exclude<TeardownLogic, void>): void;
96
+ }
97
+ //#endregion
98
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/types.d.ts
99
+ /**
100
+ * Note: This will add Symbol.observable globally for all TypeScript users,
101
+ * however, we are no longer polyfilling Symbol.observable
102
+ */
103
+ declare global {
104
+ interface SymbolConstructor {
105
+ readonly observable: symbol;
106
+ }
107
+ }
108
+ /**
109
+ * A function type interface that describes a function that accepts one parameter `T`
110
+ * and returns another parameter `R`.
111
+ *
112
+ * Usually used to describe {@link OperatorFunction} - it always takes a single
113
+ * parameter (the source Observable) and returns another Observable.
114
+ */
115
+ interface UnaryFunction<T, R> {
116
+ (source: T): R;
117
+ }
118
+ interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> {}
119
+ interface Unsubscribable {
120
+ unsubscribe(): void;
121
+ }
122
+ declare type TeardownLogic = Subscription | Unsubscribable | (() => void) | void;
123
+ interface SubscriptionLike extends Unsubscribable {
124
+ unsubscribe(): void;
125
+ readonly closed: boolean;
126
+ }
127
+ /** OBSERVABLE INTERFACES */
128
+ interface Subscribable<T> {
129
+ subscribe(observer: Partial<Observer<T>>): Unsubscribable;
130
+ }
131
+ /**
132
+ * An object interface that defines a set of callback functions a user can use to get
133
+ * notified of any set of {@link Observable}
134
+ * {@link guide/glossary-and-semantics#notification notification} events.
135
+ *
136
+ * For more info, please refer to {@link guide/observer this guide}.
137
+ */
138
+ interface Observer<T> {
139
+ /**
140
+ * A callback function that gets called by the producer during the subscription when
141
+ * the producer "has" the `value`. It won't be called if `error` or `complete` callback
142
+ * functions have been called, nor after the consumer has unsubscribed.
143
+ *
144
+ * For more info, please refer to {@link guide/glossary-and-semantics#next this guide}.
145
+ */
146
+ next: (value: T) => void;
147
+ /**
148
+ * A callback function that gets called by the producer if and when it encountered a
149
+ * problem of any kind. The errored value will be provided through the `err` parameter.
150
+ * This callback can't be called more than one time, it can't be called if the
151
+ * `complete` callback function have been called previously, nor it can't be called if
152
+ * the consumer has unsubscribed.
153
+ *
154
+ * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}.
155
+ */
156
+ error: (err: any) => void;
157
+ /**
158
+ * A callback function that gets called by the producer if and when it has no more
159
+ * values to provide (by calling `next` callback function). This means that no error
160
+ * has happened. This callback can't be called more than one time, it can't be called
161
+ * if the `error` callback function have been called previously, nor it can't be called
162
+ * if the consumer has unsubscribed.
163
+ *
164
+ * For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}.
165
+ */
166
+ complete: () => void;
167
+ }
168
+ //#endregion
169
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscriber.d.ts
170
+ /**
171
+ * Implements the {@link Observer} interface and extends the
172
+ * {@link Subscription} class. While the {@link Observer} is the public API for
173
+ * consuming the values of an {@link Observable}, all Observers get converted to
174
+ * a Subscriber, in order to provide Subscription-like capabilities such as
175
+ * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
176
+ * implementing operators, but it is rarely used as a public API.
177
+ */
178
+ declare class Subscriber<T> extends Subscription implements Observer<T> {
179
+ /**
180
+ * A static factory for a Subscriber, given a (potentially partial) definition
181
+ * of an Observer.
182
+ * @param next The `next` callback of an Observer.
183
+ * @param error The `error` callback of an
184
+ * Observer.
185
+ * @param complete The `complete` callback of an
186
+ * Observer.
187
+ * @return A Subscriber wrapping the (partially defined)
188
+ * Observer represented by the given arguments.
189
+ * @deprecated Do not use. Will be removed in v8. There is no replacement for this
190
+ * method, and there is no reason to be creating instances of `Subscriber` directly.
191
+ * If you have a specific use case, please file an issue.
192
+ */
193
+ static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
194
+ /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
195
+ protected isStopped: boolean;
196
+ /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
197
+ protected destination: Subscriber<any> | Observer<any>;
198
+ /**
199
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
200
+ * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.
201
+ */
202
+ constructor(destination?: Subscriber<any> | Observer<any>);
203
+ /**
204
+ * The {@link Observer} callback to receive notifications of type `next` from
205
+ * the Observable, with a value. The Observable may call this method 0 or more
206
+ * times.
207
+ * @param value The `next` value.
208
+ */
209
+ next(value: T): void;
210
+ /**
211
+ * The {@link Observer} callback to receive notifications of type `error` from
212
+ * the Observable, with an attached `Error`. Notifies the Observer that
213
+ * the Observable has experienced an error condition.
214
+ * @param err The `error` exception.
215
+ */
216
+ error(err?: any): void;
217
+ /**
218
+ * The {@link Observer} callback to receive a valueless notification of type
219
+ * `complete` from the Observable. Notifies the Observer that the Observable
220
+ * has finished sending push-based notifications.
221
+ */
222
+ complete(): void;
223
+ unsubscribe(): void;
224
+ protected _next(value: T): void;
225
+ protected _error(err: any): void;
226
+ protected _complete(): void;
227
+ }
228
+ //#endregion
229
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Operator.d.ts
230
+ /***
231
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
232
+ */
233
+ interface Operator<T, R> {
234
+ call(subscriber: Subscriber<R>, source: any): TeardownLogic;
235
+ }
236
+ //#endregion
237
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts
238
+ /**
239
+ * A representation of any set of values over any amount of time. This is the most basic building block
240
+ * of RxJS.
241
+ */
242
+ declare class Observable<T> implements Subscribable<T> {
243
+ /**
244
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
245
+ */
246
+ source: Observable<any> | undefined;
247
+ /**
248
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
249
+ */
250
+ operator: Operator<any, T> | undefined;
251
+ /**
252
+ * @param subscribe The function that is called when the Observable is
253
+ * initially subscribed to. This function is given a Subscriber, to which new values
254
+ * can be `next`ed, or an `error` method can be called to raise an error, or
255
+ * `complete` can be called to notify of a successful completion.
256
+ */
257
+ constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
258
+ /**
259
+ * Creates a new Observable by calling the Observable constructor
260
+ * @param subscribe the subscriber function to be passed to the Observable constructor
261
+ * @return A new observable.
262
+ * @deprecated Use `new Observable()` instead. Will be removed in v8.
263
+ */
264
+ static create: (...args: any[]) => any;
265
+ /**
266
+ * Creates a new Observable, with this Observable instance as the source, and the passed
267
+ * operator defined as the new observable's operator.
268
+ * @param operator the operator defining the operation to take on the observable
269
+ * @return A new observable with the Operator applied.
270
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
271
+ * If you have implemented an operator using `lift`, it is recommended that you create an
272
+ * operator by simply returning `new Observable()` directly. See "Creating new operators from
273
+ * scratch" section here: https://rxjs.dev/guide/operators
274
+ */
275
+ lift<R>(operator?: Operator<T, R>): Observable<R>;
276
+ subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;
277
+ /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */
278
+ subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;
279
+ /**
280
+ * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with
281
+ * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.
282
+ *
283
+ * **WARNING**: Only use this with observables you *know* will complete. If the source
284
+ * observable does not complete, you will end up with a promise that is hung up, and
285
+ * potentially all of the state of an async function hanging out in memory. To avoid
286
+ * this situation, look into adding something like {@link timeout}, {@link take},
287
+ * {@link takeWhile}, or {@link takeUntil} amongst others.
288
+ *
289
+ * #### Example
290
+ *
291
+ * ```ts
292
+ * import { interval, take } from 'rxjs';
293
+ *
294
+ * const source$ = interval(1000).pipe(take(4));
295
+ *
296
+ * async function getTotal() {
297
+ * let total = 0;
298
+ *
299
+ * await source$.forEach(value => {
300
+ * total += value;
301
+ * console.log('observable -> ' + value);
302
+ * });
303
+ *
304
+ * return total;
305
+ * }
306
+ *
307
+ * getTotal().then(
308
+ * total => console.log('Total: ' + total)
309
+ * );
310
+ *
311
+ * // Expected:
312
+ * // 'observable -> 0'
313
+ * // 'observable -> 1'
314
+ * // 'observable -> 2'
315
+ * // 'observable -> 3'
316
+ * // 'Total: 6'
317
+ * ```
318
+ *
319
+ * @param next A handler for each value emitted by the observable.
320
+ * @return A promise that either resolves on observable completion or
321
+ * rejects with the handled error.
322
+ */
323
+ forEach(next: (value: T) => void): Promise<void>;
324
+ /**
325
+ * @param next a handler for each value emitted by the observable
326
+ * @param promiseCtor a constructor function used to instantiate the Promise
327
+ * @return a promise that either resolves on observable completion or
328
+ * rejects with the handled error
329
+ * @deprecated Passing a Promise constructor will no longer be available
330
+ * in upcoming versions of RxJS. This is because it adds weight to the library, for very
331
+ * little benefit. If you need this functionality, it is recommended that you either
332
+ * polyfill Promise, or you create an adapter to convert the returned native promise
333
+ * to whatever promise implementation you wanted. Will be removed in v8.
334
+ */
335
+ forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;
336
+ pipe(): Observable<T>;
337
+ pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
338
+ pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
339
+ pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
340
+ pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
341
+ pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;
342
+ pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;
343
+ pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
344
+ pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
345
+ pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
346
+ pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<unknown>;
347
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
348
+ toPromise(): Promise<T | undefined>;
349
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
350
+ toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;
351
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
352
+ toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;
353
+ }
354
+ //#endregion
355
+ //#region src/types/index.d.ts
356
+ type LogLevel$1 = "error" | "warn" | "info" | "debug" | "verbose";
357
+ type LogFormat = "json" | "text" | "pino";
358
+ interface LogEntry {
359
+ readonly level: LogLevel$1;
360
+ readonly message: string;
361
+ readonly timestamp: Date;
362
+ readonly context?: string;
363
+ readonly metadata?: Record<string, unknown>;
364
+ readonly trace?: string;
365
+ readonly traceId?: string;
366
+ readonly spanId?: string;
367
+ }
368
+ interface LogOptions {
369
+ message: string;
370
+ context?: string;
371
+ metadata?: Record<string, unknown>;
372
+ trace?: string;
373
+ traceId?: string;
374
+ spanId?: string;
375
+ }
376
+ interface HttpRequest {
377
+ readonly id: string;
378
+ readonly method: string;
379
+ readonly url: string;
380
+ readonly query: Record<string, unknown>;
381
+ readonly params: Record<string, unknown>;
382
+ readonly headers: Record<string, string>;
383
+ readonly remoteAddress: string;
384
+ readonly remotePort?: number;
385
+ readonly body?: unknown;
386
+ }
387
+ interface HttpResponse {
388
+ readonly statusCode: number;
389
+ readonly headers: Record<string, string>;
390
+ }
391
+ interface HttpRequestLogEntry {
392
+ readonly level: number;
393
+ readonly time: number;
394
+ readonly pid: number;
395
+ readonly hostname: string;
396
+ readonly req: HttpRequest;
397
+ readonly res: HttpResponse;
398
+ readonly responseTime: number;
399
+ readonly msg: string;
400
+ readonly traceId?: string;
401
+ readonly spanId?: string;
402
+ }
403
+ interface ExcludeOption {
404
+ method: RequestMethod;
405
+ path: string;
406
+ }
407
+ interface LoggerConfiguration {
408
+ readonly level: LogLevel$1;
409
+ readonly timestamp: boolean;
410
+ readonly colors: boolean;
411
+ readonly context?: string;
412
+ readonly format: LogFormat;
413
+ readonly sensitiveFields: readonly string[];
414
+ readonly exclude: readonly ExcludeOption[];
415
+ readonly logRequests?: boolean;
416
+ }
417
+ //#endregion
418
+ //#region src/contracts/index.d.ts
419
+ interface ILogger {
420
+ log(options: LogOptions): void;
421
+ error(options: LogOptions): void;
422
+ warn(options: LogOptions): void;
423
+ debug(options: LogOptions): void;
424
+ verbose(options: LogOptions): void;
425
+ logHttpRequest(entry: HttpRequestLogEntry): void;
426
+ }
427
+ interface ILogFormatter {
428
+ format(entry: LogEntry): string;
429
+ formatHttpRequest(entry: HttpRequestLogEntry): string;
430
+ }
431
+ type LogLevel = "error" | "warn" | "info" | "debug" | "verbose";
432
+ interface ILogWriter {
433
+ write(formattedLog: string, level?: LogLevel): void;
434
+ }
435
+ interface IContextResolver {
436
+ resolve(): string;
437
+ }
438
+ interface IDataSanitizer {
439
+ sanitize(data: unknown): unknown;
440
+ }
441
+ interface IRequestIdGenerator {
442
+ generate(): string;
443
+ }
444
+ //#endregion
445
+ //#region src/core/logger.service.d.ts
446
+ declare class LoggerService implements LoggerService$1, ILogger {
447
+ private readonly config;
448
+ private readonly formatter;
449
+ private readonly writer;
450
+ private readonly contextResolver;
451
+ private readonly clsService;
452
+ private context?;
453
+ constructor(config: LoggerConfiguration, formatter: ILogFormatter, writer: ILogWriter, contextResolver: IContextResolver, clsService: ClsService);
454
+ setContext(context: string): void;
455
+ log(options: LogOptions): void;
456
+ error(options: LogOptions): void;
457
+ warn(options: LogOptions): void;
458
+ debug(options: LogOptions): void;
459
+ verbose(options: LogOptions): void;
460
+ logHttpRequest(entry: HttpRequestLogEntry): void;
461
+ private writeLog;
462
+ private resolveTraceIds;
463
+ }
464
+ //#endregion
465
+ //#region src/core/http-logger.interceptor.d.ts
466
+ declare class HttpLoggerInterceptor implements NestInterceptor {
467
+ private readonly logger;
468
+ private readonly dataSanitizer;
469
+ private readonly requestIdGenerator;
470
+ private readonly config;
471
+ private readonly reflector;
472
+ private readonly hostname;
473
+ private readonly pid;
474
+ constructor(logger: LoggerService, dataSanitizer: IDataSanitizer, requestIdGenerator: IRequestIdGenerator, config: LoggerConfiguration, reflector: Reflector);
475
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
476
+ private createHttpLogEntry;
477
+ private createLogEntry;
478
+ private getClientIp;
479
+ private sanitizeHeaders;
480
+ private getRequestMethod;
481
+ private shouldExcludeRequest;
482
+ private sanitizeGraphQLArgs;
483
+ private getGraphQLResultSize;
484
+ private extractErrorMessage;
485
+ private extractErrorTrace;
486
+ }
487
+ //#endregion
488
+ //#region src/core/logger.di-tokens.d.ts
489
+ declare const InjectLogger: (context?: string) => PropertyDecorator & ParameterDecorator;
490
+ //#endregion
491
+ //#region src/core/logger.module.d.ts
492
+ interface LoggerModuleOptions {
493
+ level?: "error" | "warn" | "info" | "debug" | "verbose";
494
+ timestamp?: boolean;
495
+ colors?: boolean;
496
+ context?: string;
497
+ format?: "json" | "text" | "pino";
498
+ sensitiveFields?: string[];
499
+ exclude?: ExcludeOption[];
500
+ logRequests?: boolean;
501
+ }
502
+ declare const ConfigurableModuleClass: _nestjs_common0.ConfigurableModuleCls<LoggerModuleOptions, "forRoot", "create", {
503
+ global: boolean;
504
+ }>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: LoggerModuleOptions & Partial<{
505
+ global: boolean;
506
+ }>, ASYNC_OPTIONS_TYPE: _nestjs_common0.ConfigurableModuleAsyncOptions<LoggerModuleOptions, "create"> & Partial<{
507
+ global: boolean;
508
+ }>;
509
+ declare class LoggerModule extends ConfigurableModuleClass implements NestModule {
510
+ configure(consumer: MiddlewareConsumer): void;
511
+ static forRoot(options?: typeof OPTIONS_TYPE): DynamicModule;
512
+ static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
513
+ private static createCoreProviders;
514
+ private static createDynamicContextProviders;
515
+ }
516
+ //#endregion
517
+ //#region src/constants/index.d.ts
518
+ declare const LOGGER_CONTEXT_METADATA: unique symbol;
519
+ declare const LOGGER_METADATA_METADATA: unique symbol;
520
+ declare const LOGGER_EXCLUDE_METADATA: unique symbol;
521
+ //#endregion
522
+ //#region src/decorators/index.d.ts
523
+ /**
524
+ * Decorator to set logging context for a class or method
525
+ */
526
+ declare const LogContext: (context: string) => _nestjs_common0.CustomDecorator<typeof LOGGER_CONTEXT_METADATA>;
527
+ /**
528
+ * Decorator to add metadata to logs
529
+ */
530
+ declare const LogMetadata: (metadata: Record<string, unknown>) => _nestjs_common0.CustomDecorator<typeof LOGGER_METADATA_METADATA>;
531
+ /**
532
+ * Decorator to exclude logging for a controller or method
533
+ */
534
+ declare const ExcludeLogging: () => _nestjs_common0.CustomDecorator<typeof LOGGER_EXCLUDE_METADATA>;
535
+ //#endregion
536
+ export { ExcludeLogging, HttpLoggerInterceptor, InjectLogger, LogContext, LogMetadata, LoggerModule, LoggerService };
537
+ //# sourceMappingURL=index.d.cts.map