@rawnodes/logger 1.7.0 → 1.9.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.
- package/README.md +233 -2
- package/dist/index.d.mts +898 -6
- package/dist/index.d.ts +898 -6
- package/dist/index.js +605 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +585 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import TransportStream from 'winston-transport';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
1
4
|
declare const LOG_LEVELS: {
|
|
5
|
+
readonly off: -1;
|
|
2
6
|
readonly error: 0;
|
|
3
7
|
readonly warn: 1;
|
|
4
8
|
readonly info: 2;
|
|
@@ -11,11 +15,21 @@ type LogLevel = keyof typeof LOG_LEVELS;
|
|
|
11
15
|
declare function isValidLogLevel(level: string): level is LogLevel;
|
|
12
16
|
declare function assertLogLevel(level: string): asserts level is LogLevel;
|
|
13
17
|
type LogFormat = 'json' | 'plain' | 'logfmt' | 'simple';
|
|
18
|
+
interface LevelRule {
|
|
19
|
+
match: Record<string, unknown> & {
|
|
20
|
+
context?: string;
|
|
21
|
+
};
|
|
22
|
+
level: LogLevel;
|
|
23
|
+
}
|
|
14
24
|
interface ConsoleConfig {
|
|
15
25
|
format: LogFormat;
|
|
26
|
+
level?: LogLevel;
|
|
27
|
+
rules?: LevelRule[];
|
|
16
28
|
}
|
|
17
29
|
interface FileConfig {
|
|
18
30
|
format: LogFormat;
|
|
31
|
+
level?: LogLevel;
|
|
32
|
+
rules?: LevelRule[];
|
|
19
33
|
dirname: string;
|
|
20
34
|
filename: string;
|
|
21
35
|
datePattern?: string;
|
|
@@ -23,11 +37,39 @@ interface FileConfig {
|
|
|
23
37
|
maxSize?: string;
|
|
24
38
|
maxFiles?: string;
|
|
25
39
|
}
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
interface HttpTransportBaseConfig {
|
|
41
|
+
level?: LogLevel;
|
|
42
|
+
rules?: LevelRule[];
|
|
43
|
+
batchSize?: number;
|
|
44
|
+
flushInterval?: number;
|
|
45
|
+
maxRetries?: number;
|
|
46
|
+
retryDelay?: number;
|
|
47
|
+
}
|
|
48
|
+
interface DiscordConfig extends HttpTransportBaseConfig {
|
|
49
|
+
webhookUrl: string;
|
|
50
|
+
username?: string;
|
|
51
|
+
avatarUrl?: string;
|
|
52
|
+
embedColors?: Partial<Record<LogLevel, number>>;
|
|
53
|
+
includeTimestamp?: boolean;
|
|
54
|
+
includeMeta?: boolean;
|
|
55
|
+
maxEmbedFields?: number;
|
|
56
|
+
}
|
|
57
|
+
interface TelegramConfig extends HttpTransportBaseConfig {
|
|
58
|
+
botToken: string;
|
|
59
|
+
chatId: string | number;
|
|
60
|
+
parseMode?: 'Markdown' | 'MarkdownV2' | 'HTML';
|
|
61
|
+
disableNotification?: boolean;
|
|
62
|
+
threadId?: number;
|
|
63
|
+
replyToMessageId?: number;
|
|
64
|
+
}
|
|
65
|
+
interface CloudWatchConfig extends HttpTransportBaseConfig {
|
|
66
|
+
logGroupName: string;
|
|
67
|
+
logStreamName: string;
|
|
68
|
+
region: string;
|
|
69
|
+
accessKeyId: string;
|
|
70
|
+
secretAccessKey: string;
|
|
71
|
+
createLogGroup?: boolean;
|
|
72
|
+
createLogStream?: boolean;
|
|
31
73
|
}
|
|
32
74
|
interface LevelConfigObject {
|
|
33
75
|
default: LogLevel;
|
|
@@ -38,6 +80,9 @@ interface LoggerConfig {
|
|
|
38
80
|
level: LevelConfig;
|
|
39
81
|
console: ConsoleConfig;
|
|
40
82
|
file?: FileConfig;
|
|
83
|
+
discord?: DiscordConfig | DiscordConfig[];
|
|
84
|
+
telegram?: TelegramConfig | TelegramConfig[];
|
|
85
|
+
cloudwatch?: CloudWatchConfig | CloudWatchConfig[];
|
|
41
86
|
}
|
|
42
87
|
type LoggerContext = Record<string, unknown>;
|
|
43
88
|
type LevelOverrideMatch<TContext extends LoggerContext> = Partial<TContext> & {
|
|
@@ -90,6 +135,98 @@ interface SingletonLogger<TContext extends LoggerContext> {
|
|
|
90
135
|
}
|
|
91
136
|
declare function createSingletonLogger<TContext extends LoggerContext = LoggerContext>(): SingletonLogger<TContext>;
|
|
92
137
|
|
|
138
|
+
declare function matchesContext(storeContext: LoggerContext | undefined, loggerContext: string | undefined, match: Record<string, unknown> & {
|
|
139
|
+
context?: string;
|
|
140
|
+
}): boolean;
|
|
141
|
+
|
|
142
|
+
interface BufferedMessage {
|
|
143
|
+
level: LogLevel;
|
|
144
|
+
message: string;
|
|
145
|
+
timestamp: Date;
|
|
146
|
+
context?: string;
|
|
147
|
+
meta?: Record<string, unknown>;
|
|
148
|
+
}
|
|
149
|
+
interface BufferOptions {
|
|
150
|
+
batchSize: number;
|
|
151
|
+
flushInterval: number;
|
|
152
|
+
maxRetries: number;
|
|
153
|
+
retryDelay: number;
|
|
154
|
+
onFlush: (messages: BufferedMessage[]) => Promise<void>;
|
|
155
|
+
onError?: (error: Error, messages: BufferedMessage[]) => void;
|
|
156
|
+
}
|
|
157
|
+
declare class MessageBuffer {
|
|
158
|
+
private options;
|
|
159
|
+
private queue;
|
|
160
|
+
private timer;
|
|
161
|
+
private flushing;
|
|
162
|
+
private closed;
|
|
163
|
+
constructor(options: BufferOptions);
|
|
164
|
+
add(message: BufferedMessage): void;
|
|
165
|
+
flush(): Promise<void>;
|
|
166
|
+
close(): Promise<void>;
|
|
167
|
+
private scheduleFlush;
|
|
168
|
+
private clearTimer;
|
|
169
|
+
private sendWithRetry;
|
|
170
|
+
private delay;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface BaseHttpTransportOptions {
|
|
174
|
+
batchSize?: number;
|
|
175
|
+
flushInterval?: number;
|
|
176
|
+
maxRetries?: number;
|
|
177
|
+
retryDelay?: number;
|
|
178
|
+
}
|
|
179
|
+
declare abstract class BaseHttpTransport extends TransportStream {
|
|
180
|
+
protected buffer: MessageBuffer;
|
|
181
|
+
constructor(opts?: BaseHttpTransportOptions);
|
|
182
|
+
log(info: Record<string, unknown>, callback: () => void): void;
|
|
183
|
+
close(): Promise<void>;
|
|
184
|
+
protected transformMessage(info: Record<string, unknown>): BufferedMessage;
|
|
185
|
+
protected handleError(error: Error, messages: BufferedMessage[]): void;
|
|
186
|
+
protected abstract sendBatch(messages: BufferedMessage[]): Promise<void>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class DiscordTransport extends BaseHttpTransport {
|
|
190
|
+
private config;
|
|
191
|
+
constructor(config: DiscordConfig);
|
|
192
|
+
protected sendBatch(messages: BufferedMessage[]): Promise<void>;
|
|
193
|
+
private createEmbed;
|
|
194
|
+
private metaToFields;
|
|
195
|
+
private sendWebhook;
|
|
196
|
+
private chunkArray;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare class TelegramTransport extends BaseHttpTransport {
|
|
200
|
+
private config;
|
|
201
|
+
private apiUrl;
|
|
202
|
+
constructor(config: TelegramConfig);
|
|
203
|
+
protected sendBatch(messages: BufferedMessage[]): Promise<void>;
|
|
204
|
+
private formatBatchMessage;
|
|
205
|
+
private formatMarkdown;
|
|
206
|
+
private formatHtml;
|
|
207
|
+
private shouldMute;
|
|
208
|
+
private sendMessage;
|
|
209
|
+
private escapeMarkdownV2;
|
|
210
|
+
private escapeHtml;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare class CloudWatchTransport extends BaseHttpTransport {
|
|
214
|
+
private config;
|
|
215
|
+
private client;
|
|
216
|
+
private sequenceToken;
|
|
217
|
+
private initialized;
|
|
218
|
+
private initPromise;
|
|
219
|
+
constructor(config: CloudWatchConfig);
|
|
220
|
+
protected sendBatch(messages: BufferedMessage[]): Promise<void>;
|
|
221
|
+
private ensureInitialized;
|
|
222
|
+
private initialize;
|
|
223
|
+
private createLogGroupIfNotExists;
|
|
224
|
+
private createLogStreamIfNotExists;
|
|
225
|
+
private fetchSequenceToken;
|
|
226
|
+
private isResourceAlreadyExistsError;
|
|
227
|
+
private isInvalidSequenceTokenError;
|
|
228
|
+
}
|
|
229
|
+
|
|
93
230
|
interface TimingResult {
|
|
94
231
|
label: string;
|
|
95
232
|
durationMs: number;
|
|
@@ -124,4 +261,759 @@ declare function flattenObject(obj: Record<string, unknown>, prefix?: string): R
|
|
|
124
261
|
declare function formatLogfmtValue(value: unknown): string;
|
|
125
262
|
declare function formatLogfmt(data: Record<string, unknown>): string;
|
|
126
263
|
|
|
127
|
-
|
|
264
|
+
declare const LogLevelSchema: z.ZodEnum<{
|
|
265
|
+
off: "off";
|
|
266
|
+
error: "error";
|
|
267
|
+
warn: "warn";
|
|
268
|
+
info: "info";
|
|
269
|
+
http: "http";
|
|
270
|
+
verbose: "verbose";
|
|
271
|
+
debug: "debug";
|
|
272
|
+
silly: "silly";
|
|
273
|
+
}>;
|
|
274
|
+
declare const LogFormatSchema: z.ZodEnum<{
|
|
275
|
+
json: "json";
|
|
276
|
+
plain: "plain";
|
|
277
|
+
logfmt: "logfmt";
|
|
278
|
+
simple: "simple";
|
|
279
|
+
}>;
|
|
280
|
+
declare const LevelRuleSchema: z.ZodObject<{
|
|
281
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
282
|
+
level: z.ZodEnum<{
|
|
283
|
+
off: "off";
|
|
284
|
+
error: "error";
|
|
285
|
+
warn: "warn";
|
|
286
|
+
info: "info";
|
|
287
|
+
http: "http";
|
|
288
|
+
verbose: "verbose";
|
|
289
|
+
debug: "debug";
|
|
290
|
+
silly: "silly";
|
|
291
|
+
}>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
declare const ConsoleConfigSchema: z.ZodObject<{
|
|
294
|
+
format: z.ZodEnum<{
|
|
295
|
+
json: "json";
|
|
296
|
+
plain: "plain";
|
|
297
|
+
logfmt: "logfmt";
|
|
298
|
+
simple: "simple";
|
|
299
|
+
}>;
|
|
300
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
301
|
+
off: "off";
|
|
302
|
+
error: "error";
|
|
303
|
+
warn: "warn";
|
|
304
|
+
info: "info";
|
|
305
|
+
http: "http";
|
|
306
|
+
verbose: "verbose";
|
|
307
|
+
debug: "debug";
|
|
308
|
+
silly: "silly";
|
|
309
|
+
}>>;
|
|
310
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
311
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
312
|
+
level: z.ZodEnum<{
|
|
313
|
+
off: "off";
|
|
314
|
+
error: "error";
|
|
315
|
+
warn: "warn";
|
|
316
|
+
info: "info";
|
|
317
|
+
http: "http";
|
|
318
|
+
verbose: "verbose";
|
|
319
|
+
debug: "debug";
|
|
320
|
+
silly: "silly";
|
|
321
|
+
}>;
|
|
322
|
+
}, z.core.$strip>>>;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
declare const FileConfigSchema: z.ZodObject<{
|
|
325
|
+
format: z.ZodEnum<{
|
|
326
|
+
json: "json";
|
|
327
|
+
plain: "plain";
|
|
328
|
+
logfmt: "logfmt";
|
|
329
|
+
simple: "simple";
|
|
330
|
+
}>;
|
|
331
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
332
|
+
off: "off";
|
|
333
|
+
error: "error";
|
|
334
|
+
warn: "warn";
|
|
335
|
+
info: "info";
|
|
336
|
+
http: "http";
|
|
337
|
+
verbose: "verbose";
|
|
338
|
+
debug: "debug";
|
|
339
|
+
silly: "silly";
|
|
340
|
+
}>>;
|
|
341
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
342
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
343
|
+
level: z.ZodEnum<{
|
|
344
|
+
off: "off";
|
|
345
|
+
error: "error";
|
|
346
|
+
warn: "warn";
|
|
347
|
+
info: "info";
|
|
348
|
+
http: "http";
|
|
349
|
+
verbose: "verbose";
|
|
350
|
+
debug: "debug";
|
|
351
|
+
silly: "silly";
|
|
352
|
+
}>;
|
|
353
|
+
}, z.core.$strip>>>;
|
|
354
|
+
dirname: z.ZodString;
|
|
355
|
+
filename: z.ZodString;
|
|
356
|
+
datePattern: z.ZodOptional<z.ZodString>;
|
|
357
|
+
zippedArchive: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
maxSize: z.ZodOptional<z.ZodString>;
|
|
359
|
+
maxFiles: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
declare const HttpTransportBaseConfigSchema: z.ZodObject<{
|
|
362
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
363
|
+
off: "off";
|
|
364
|
+
error: "error";
|
|
365
|
+
warn: "warn";
|
|
366
|
+
info: "info";
|
|
367
|
+
http: "http";
|
|
368
|
+
verbose: "verbose";
|
|
369
|
+
debug: "debug";
|
|
370
|
+
silly: "silly";
|
|
371
|
+
}>>;
|
|
372
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
373
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
374
|
+
level: z.ZodEnum<{
|
|
375
|
+
off: "off";
|
|
376
|
+
error: "error";
|
|
377
|
+
warn: "warn";
|
|
378
|
+
info: "info";
|
|
379
|
+
http: "http";
|
|
380
|
+
verbose: "verbose";
|
|
381
|
+
debug: "debug";
|
|
382
|
+
silly: "silly";
|
|
383
|
+
}>;
|
|
384
|
+
}, z.core.$strip>>>;
|
|
385
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
386
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
387
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
declare const DiscordConfigSchema: z.ZodObject<{
|
|
391
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
392
|
+
off: "off";
|
|
393
|
+
error: "error";
|
|
394
|
+
warn: "warn";
|
|
395
|
+
info: "info";
|
|
396
|
+
http: "http";
|
|
397
|
+
verbose: "verbose";
|
|
398
|
+
debug: "debug";
|
|
399
|
+
silly: "silly";
|
|
400
|
+
}>>;
|
|
401
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
402
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
403
|
+
level: z.ZodEnum<{
|
|
404
|
+
off: "off";
|
|
405
|
+
error: "error";
|
|
406
|
+
warn: "warn";
|
|
407
|
+
info: "info";
|
|
408
|
+
http: "http";
|
|
409
|
+
verbose: "verbose";
|
|
410
|
+
debug: "debug";
|
|
411
|
+
silly: "silly";
|
|
412
|
+
}>;
|
|
413
|
+
}, z.core.$strip>>>;
|
|
414
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
415
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
417
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
webhookUrl: z.ZodURL;
|
|
419
|
+
username: z.ZodOptional<z.ZodString>;
|
|
420
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
421
|
+
embedColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
422
|
+
includeTimestamp: z.ZodOptional<z.ZodBoolean>;
|
|
423
|
+
includeMeta: z.ZodOptional<z.ZodBoolean>;
|
|
424
|
+
maxEmbedFields: z.ZodOptional<z.ZodNumber>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
declare const TelegramConfigSchema: z.ZodObject<{
|
|
427
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
428
|
+
off: "off";
|
|
429
|
+
error: "error";
|
|
430
|
+
warn: "warn";
|
|
431
|
+
info: "info";
|
|
432
|
+
http: "http";
|
|
433
|
+
verbose: "verbose";
|
|
434
|
+
debug: "debug";
|
|
435
|
+
silly: "silly";
|
|
436
|
+
}>>;
|
|
437
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
438
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
439
|
+
level: z.ZodEnum<{
|
|
440
|
+
off: "off";
|
|
441
|
+
error: "error";
|
|
442
|
+
warn: "warn";
|
|
443
|
+
info: "info";
|
|
444
|
+
http: "http";
|
|
445
|
+
verbose: "verbose";
|
|
446
|
+
debug: "debug";
|
|
447
|
+
silly: "silly";
|
|
448
|
+
}>;
|
|
449
|
+
}, z.core.$strip>>>;
|
|
450
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
453
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
454
|
+
botToken: z.ZodString;
|
|
455
|
+
chatId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
456
|
+
parseMode: z.ZodOptional<z.ZodEnum<{
|
|
457
|
+
Markdown: "Markdown";
|
|
458
|
+
MarkdownV2: "MarkdownV2";
|
|
459
|
+
HTML: "HTML";
|
|
460
|
+
}>>;
|
|
461
|
+
disableNotification: z.ZodOptional<z.ZodBoolean>;
|
|
462
|
+
threadId: z.ZodOptional<z.ZodNumber>;
|
|
463
|
+
replyToMessageId: z.ZodOptional<z.ZodNumber>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
declare const CloudWatchConfigSchema: z.ZodObject<{
|
|
466
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
467
|
+
off: "off";
|
|
468
|
+
error: "error";
|
|
469
|
+
warn: "warn";
|
|
470
|
+
info: "info";
|
|
471
|
+
http: "http";
|
|
472
|
+
verbose: "verbose";
|
|
473
|
+
debug: "debug";
|
|
474
|
+
silly: "silly";
|
|
475
|
+
}>>;
|
|
476
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
477
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
478
|
+
level: z.ZodEnum<{
|
|
479
|
+
off: "off";
|
|
480
|
+
error: "error";
|
|
481
|
+
warn: "warn";
|
|
482
|
+
info: "info";
|
|
483
|
+
http: "http";
|
|
484
|
+
verbose: "verbose";
|
|
485
|
+
debug: "debug";
|
|
486
|
+
silly: "silly";
|
|
487
|
+
}>;
|
|
488
|
+
}, z.core.$strip>>>;
|
|
489
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
492
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
493
|
+
logGroupName: z.ZodString;
|
|
494
|
+
logStreamName: z.ZodString;
|
|
495
|
+
region: z.ZodString;
|
|
496
|
+
accessKeyId: z.ZodString;
|
|
497
|
+
secretAccessKey: z.ZodString;
|
|
498
|
+
createLogGroup: z.ZodOptional<z.ZodBoolean>;
|
|
499
|
+
createLogStream: z.ZodOptional<z.ZodBoolean>;
|
|
500
|
+
}, z.core.$strip>;
|
|
501
|
+
declare const LevelConfigObjectSchema: z.ZodObject<{
|
|
502
|
+
default: z.ZodEnum<{
|
|
503
|
+
off: "off";
|
|
504
|
+
error: "error";
|
|
505
|
+
warn: "warn";
|
|
506
|
+
info: "info";
|
|
507
|
+
http: "http";
|
|
508
|
+
verbose: "verbose";
|
|
509
|
+
debug: "debug";
|
|
510
|
+
silly: "silly";
|
|
511
|
+
}>;
|
|
512
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
513
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
514
|
+
level: z.ZodEnum<{
|
|
515
|
+
off: "off";
|
|
516
|
+
error: "error";
|
|
517
|
+
warn: "warn";
|
|
518
|
+
info: "info";
|
|
519
|
+
http: "http";
|
|
520
|
+
verbose: "verbose";
|
|
521
|
+
debug: "debug";
|
|
522
|
+
silly: "silly";
|
|
523
|
+
}>;
|
|
524
|
+
}, z.core.$strip>>>;
|
|
525
|
+
}, z.core.$strip>;
|
|
526
|
+
declare const LevelConfigSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
527
|
+
off: "off";
|
|
528
|
+
error: "error";
|
|
529
|
+
warn: "warn";
|
|
530
|
+
info: "info";
|
|
531
|
+
http: "http";
|
|
532
|
+
verbose: "verbose";
|
|
533
|
+
debug: "debug";
|
|
534
|
+
silly: "silly";
|
|
535
|
+
}>, z.ZodObject<{
|
|
536
|
+
default: z.ZodEnum<{
|
|
537
|
+
off: "off";
|
|
538
|
+
error: "error";
|
|
539
|
+
warn: "warn";
|
|
540
|
+
info: "info";
|
|
541
|
+
http: "http";
|
|
542
|
+
verbose: "verbose";
|
|
543
|
+
debug: "debug";
|
|
544
|
+
silly: "silly";
|
|
545
|
+
}>;
|
|
546
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
547
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
548
|
+
level: z.ZodEnum<{
|
|
549
|
+
off: "off";
|
|
550
|
+
error: "error";
|
|
551
|
+
warn: "warn";
|
|
552
|
+
info: "info";
|
|
553
|
+
http: "http";
|
|
554
|
+
verbose: "verbose";
|
|
555
|
+
debug: "debug";
|
|
556
|
+
silly: "silly";
|
|
557
|
+
}>;
|
|
558
|
+
}, z.core.$strip>>>;
|
|
559
|
+
}, z.core.$strip>]>;
|
|
560
|
+
declare const LoggerConfigSchema: z.ZodObject<{
|
|
561
|
+
level: z.ZodUnion<readonly [z.ZodEnum<{
|
|
562
|
+
off: "off";
|
|
563
|
+
error: "error";
|
|
564
|
+
warn: "warn";
|
|
565
|
+
info: "info";
|
|
566
|
+
http: "http";
|
|
567
|
+
verbose: "verbose";
|
|
568
|
+
debug: "debug";
|
|
569
|
+
silly: "silly";
|
|
570
|
+
}>, z.ZodObject<{
|
|
571
|
+
default: z.ZodEnum<{
|
|
572
|
+
off: "off";
|
|
573
|
+
error: "error";
|
|
574
|
+
warn: "warn";
|
|
575
|
+
info: "info";
|
|
576
|
+
http: "http";
|
|
577
|
+
verbose: "verbose";
|
|
578
|
+
debug: "debug";
|
|
579
|
+
silly: "silly";
|
|
580
|
+
}>;
|
|
581
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
582
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
583
|
+
level: z.ZodEnum<{
|
|
584
|
+
off: "off";
|
|
585
|
+
error: "error";
|
|
586
|
+
warn: "warn";
|
|
587
|
+
info: "info";
|
|
588
|
+
http: "http";
|
|
589
|
+
verbose: "verbose";
|
|
590
|
+
debug: "debug";
|
|
591
|
+
silly: "silly";
|
|
592
|
+
}>;
|
|
593
|
+
}, z.core.$strip>>>;
|
|
594
|
+
}, z.core.$strip>]>;
|
|
595
|
+
console: z.ZodObject<{
|
|
596
|
+
format: z.ZodEnum<{
|
|
597
|
+
json: "json";
|
|
598
|
+
plain: "plain";
|
|
599
|
+
logfmt: "logfmt";
|
|
600
|
+
simple: "simple";
|
|
601
|
+
}>;
|
|
602
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
603
|
+
off: "off";
|
|
604
|
+
error: "error";
|
|
605
|
+
warn: "warn";
|
|
606
|
+
info: "info";
|
|
607
|
+
http: "http";
|
|
608
|
+
verbose: "verbose";
|
|
609
|
+
debug: "debug";
|
|
610
|
+
silly: "silly";
|
|
611
|
+
}>>;
|
|
612
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
613
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
614
|
+
level: z.ZodEnum<{
|
|
615
|
+
off: "off";
|
|
616
|
+
error: "error";
|
|
617
|
+
warn: "warn";
|
|
618
|
+
info: "info";
|
|
619
|
+
http: "http";
|
|
620
|
+
verbose: "verbose";
|
|
621
|
+
debug: "debug";
|
|
622
|
+
silly: "silly";
|
|
623
|
+
}>;
|
|
624
|
+
}, z.core.$strip>>>;
|
|
625
|
+
}, z.core.$strip>;
|
|
626
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
627
|
+
format: z.ZodEnum<{
|
|
628
|
+
json: "json";
|
|
629
|
+
plain: "plain";
|
|
630
|
+
logfmt: "logfmt";
|
|
631
|
+
simple: "simple";
|
|
632
|
+
}>;
|
|
633
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
634
|
+
off: "off";
|
|
635
|
+
error: "error";
|
|
636
|
+
warn: "warn";
|
|
637
|
+
info: "info";
|
|
638
|
+
http: "http";
|
|
639
|
+
verbose: "verbose";
|
|
640
|
+
debug: "debug";
|
|
641
|
+
silly: "silly";
|
|
642
|
+
}>>;
|
|
643
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
644
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
645
|
+
level: z.ZodEnum<{
|
|
646
|
+
off: "off";
|
|
647
|
+
error: "error";
|
|
648
|
+
warn: "warn";
|
|
649
|
+
info: "info";
|
|
650
|
+
http: "http";
|
|
651
|
+
verbose: "verbose";
|
|
652
|
+
debug: "debug";
|
|
653
|
+
silly: "silly";
|
|
654
|
+
}>;
|
|
655
|
+
}, z.core.$strip>>>;
|
|
656
|
+
dirname: z.ZodString;
|
|
657
|
+
filename: z.ZodString;
|
|
658
|
+
datePattern: z.ZodOptional<z.ZodString>;
|
|
659
|
+
zippedArchive: z.ZodOptional<z.ZodBoolean>;
|
|
660
|
+
maxSize: z.ZodOptional<z.ZodString>;
|
|
661
|
+
maxFiles: z.ZodOptional<z.ZodString>;
|
|
662
|
+
}, z.core.$strip>>;
|
|
663
|
+
discord: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
664
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
665
|
+
off: "off";
|
|
666
|
+
error: "error";
|
|
667
|
+
warn: "warn";
|
|
668
|
+
info: "info";
|
|
669
|
+
http: "http";
|
|
670
|
+
verbose: "verbose";
|
|
671
|
+
debug: "debug";
|
|
672
|
+
silly: "silly";
|
|
673
|
+
}>>;
|
|
674
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
675
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
676
|
+
level: z.ZodEnum<{
|
|
677
|
+
off: "off";
|
|
678
|
+
error: "error";
|
|
679
|
+
warn: "warn";
|
|
680
|
+
info: "info";
|
|
681
|
+
http: "http";
|
|
682
|
+
verbose: "verbose";
|
|
683
|
+
debug: "debug";
|
|
684
|
+
silly: "silly";
|
|
685
|
+
}>;
|
|
686
|
+
}, z.core.$strip>>>;
|
|
687
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
688
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
689
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
690
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
691
|
+
webhookUrl: z.ZodURL;
|
|
692
|
+
username: z.ZodOptional<z.ZodString>;
|
|
693
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
694
|
+
embedColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
695
|
+
includeTimestamp: z.ZodOptional<z.ZodBoolean>;
|
|
696
|
+
includeMeta: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
+
maxEmbedFields: z.ZodOptional<z.ZodNumber>;
|
|
698
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
699
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
700
|
+
off: "off";
|
|
701
|
+
error: "error";
|
|
702
|
+
warn: "warn";
|
|
703
|
+
info: "info";
|
|
704
|
+
http: "http";
|
|
705
|
+
verbose: "verbose";
|
|
706
|
+
debug: "debug";
|
|
707
|
+
silly: "silly";
|
|
708
|
+
}>>;
|
|
709
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
710
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
711
|
+
level: z.ZodEnum<{
|
|
712
|
+
off: "off";
|
|
713
|
+
error: "error";
|
|
714
|
+
warn: "warn";
|
|
715
|
+
info: "info";
|
|
716
|
+
http: "http";
|
|
717
|
+
verbose: "verbose";
|
|
718
|
+
debug: "debug";
|
|
719
|
+
silly: "silly";
|
|
720
|
+
}>;
|
|
721
|
+
}, z.core.$strip>>>;
|
|
722
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
723
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
724
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
725
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
726
|
+
webhookUrl: z.ZodURL;
|
|
727
|
+
username: z.ZodOptional<z.ZodString>;
|
|
728
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
729
|
+
embedColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
730
|
+
includeTimestamp: z.ZodOptional<z.ZodBoolean>;
|
|
731
|
+
includeMeta: z.ZodOptional<z.ZodBoolean>;
|
|
732
|
+
maxEmbedFields: z.ZodOptional<z.ZodNumber>;
|
|
733
|
+
}, z.core.$strip>>]>>;
|
|
734
|
+
telegram: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
735
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
736
|
+
off: "off";
|
|
737
|
+
error: "error";
|
|
738
|
+
warn: "warn";
|
|
739
|
+
info: "info";
|
|
740
|
+
http: "http";
|
|
741
|
+
verbose: "verbose";
|
|
742
|
+
debug: "debug";
|
|
743
|
+
silly: "silly";
|
|
744
|
+
}>>;
|
|
745
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
746
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
747
|
+
level: z.ZodEnum<{
|
|
748
|
+
off: "off";
|
|
749
|
+
error: "error";
|
|
750
|
+
warn: "warn";
|
|
751
|
+
info: "info";
|
|
752
|
+
http: "http";
|
|
753
|
+
verbose: "verbose";
|
|
754
|
+
debug: "debug";
|
|
755
|
+
silly: "silly";
|
|
756
|
+
}>;
|
|
757
|
+
}, z.core.$strip>>>;
|
|
758
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
759
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
760
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
761
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
762
|
+
botToken: z.ZodString;
|
|
763
|
+
chatId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
764
|
+
parseMode: z.ZodOptional<z.ZodEnum<{
|
|
765
|
+
Markdown: "Markdown";
|
|
766
|
+
MarkdownV2: "MarkdownV2";
|
|
767
|
+
HTML: "HTML";
|
|
768
|
+
}>>;
|
|
769
|
+
disableNotification: z.ZodOptional<z.ZodBoolean>;
|
|
770
|
+
threadId: z.ZodOptional<z.ZodNumber>;
|
|
771
|
+
replyToMessageId: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
773
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
774
|
+
off: "off";
|
|
775
|
+
error: "error";
|
|
776
|
+
warn: "warn";
|
|
777
|
+
info: "info";
|
|
778
|
+
http: "http";
|
|
779
|
+
verbose: "verbose";
|
|
780
|
+
debug: "debug";
|
|
781
|
+
silly: "silly";
|
|
782
|
+
}>>;
|
|
783
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
784
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
785
|
+
level: z.ZodEnum<{
|
|
786
|
+
off: "off";
|
|
787
|
+
error: "error";
|
|
788
|
+
warn: "warn";
|
|
789
|
+
info: "info";
|
|
790
|
+
http: "http";
|
|
791
|
+
verbose: "verbose";
|
|
792
|
+
debug: "debug";
|
|
793
|
+
silly: "silly";
|
|
794
|
+
}>;
|
|
795
|
+
}, z.core.$strip>>>;
|
|
796
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
797
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
798
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
799
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
800
|
+
botToken: z.ZodString;
|
|
801
|
+
chatId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
802
|
+
parseMode: z.ZodOptional<z.ZodEnum<{
|
|
803
|
+
Markdown: "Markdown";
|
|
804
|
+
MarkdownV2: "MarkdownV2";
|
|
805
|
+
HTML: "HTML";
|
|
806
|
+
}>>;
|
|
807
|
+
disableNotification: z.ZodOptional<z.ZodBoolean>;
|
|
808
|
+
threadId: z.ZodOptional<z.ZodNumber>;
|
|
809
|
+
replyToMessageId: z.ZodOptional<z.ZodNumber>;
|
|
810
|
+
}, z.core.$strip>>]>>;
|
|
811
|
+
cloudwatch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
812
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
813
|
+
off: "off";
|
|
814
|
+
error: "error";
|
|
815
|
+
warn: "warn";
|
|
816
|
+
info: "info";
|
|
817
|
+
http: "http";
|
|
818
|
+
verbose: "verbose";
|
|
819
|
+
debug: "debug";
|
|
820
|
+
silly: "silly";
|
|
821
|
+
}>>;
|
|
822
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
823
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
824
|
+
level: z.ZodEnum<{
|
|
825
|
+
off: "off";
|
|
826
|
+
error: "error";
|
|
827
|
+
warn: "warn";
|
|
828
|
+
info: "info";
|
|
829
|
+
http: "http";
|
|
830
|
+
verbose: "verbose";
|
|
831
|
+
debug: "debug";
|
|
832
|
+
silly: "silly";
|
|
833
|
+
}>;
|
|
834
|
+
}, z.core.$strip>>>;
|
|
835
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
836
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
837
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
838
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
839
|
+
logGroupName: z.ZodString;
|
|
840
|
+
logStreamName: z.ZodString;
|
|
841
|
+
region: z.ZodString;
|
|
842
|
+
accessKeyId: z.ZodString;
|
|
843
|
+
secretAccessKey: z.ZodString;
|
|
844
|
+
createLogGroup: z.ZodOptional<z.ZodBoolean>;
|
|
845
|
+
createLogStream: z.ZodOptional<z.ZodBoolean>;
|
|
846
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
847
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
848
|
+
off: "off";
|
|
849
|
+
error: "error";
|
|
850
|
+
warn: "warn";
|
|
851
|
+
info: "info";
|
|
852
|
+
http: "http";
|
|
853
|
+
verbose: "verbose";
|
|
854
|
+
debug: "debug";
|
|
855
|
+
silly: "silly";
|
|
856
|
+
}>>;
|
|
857
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
858
|
+
match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
859
|
+
level: z.ZodEnum<{
|
|
860
|
+
off: "off";
|
|
861
|
+
error: "error";
|
|
862
|
+
warn: "warn";
|
|
863
|
+
info: "info";
|
|
864
|
+
http: "http";
|
|
865
|
+
verbose: "verbose";
|
|
866
|
+
debug: "debug";
|
|
867
|
+
silly: "silly";
|
|
868
|
+
}>;
|
|
869
|
+
}, z.core.$strip>>>;
|
|
870
|
+
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
871
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
872
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
873
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
874
|
+
logGroupName: z.ZodString;
|
|
875
|
+
logStreamName: z.ZodString;
|
|
876
|
+
region: z.ZodString;
|
|
877
|
+
accessKeyId: z.ZodString;
|
|
878
|
+
secretAccessKey: z.ZodString;
|
|
879
|
+
createLogGroup: z.ZodOptional<z.ZodBoolean>;
|
|
880
|
+
createLogStream: z.ZodOptional<z.ZodBoolean>;
|
|
881
|
+
}, z.core.$strip>>]>>;
|
|
882
|
+
}, z.core.$strip>;
|
|
883
|
+
declare function validateConfig(config: unknown): z.infer<typeof LoggerConfigSchema>;
|
|
884
|
+
declare function safeValidateConfig(config: unknown): z.ZodSafeParseResult<{
|
|
885
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | {
|
|
886
|
+
default: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
887
|
+
rules?: {
|
|
888
|
+
match: Record<string, unknown>;
|
|
889
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
890
|
+
}[] | undefined;
|
|
891
|
+
};
|
|
892
|
+
console: {
|
|
893
|
+
format: "json" | "plain" | "logfmt" | "simple";
|
|
894
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
895
|
+
rules?: {
|
|
896
|
+
match: Record<string, unknown>;
|
|
897
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
898
|
+
}[] | undefined;
|
|
899
|
+
};
|
|
900
|
+
file?: {
|
|
901
|
+
format: "json" | "plain" | "logfmt" | "simple";
|
|
902
|
+
dirname: string;
|
|
903
|
+
filename: string;
|
|
904
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
905
|
+
rules?: {
|
|
906
|
+
match: Record<string, unknown>;
|
|
907
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
908
|
+
}[] | undefined;
|
|
909
|
+
datePattern?: string | undefined;
|
|
910
|
+
zippedArchive?: boolean | undefined;
|
|
911
|
+
maxSize?: string | undefined;
|
|
912
|
+
maxFiles?: string | undefined;
|
|
913
|
+
} | undefined;
|
|
914
|
+
discord?: {
|
|
915
|
+
webhookUrl: string;
|
|
916
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
917
|
+
rules?: {
|
|
918
|
+
match: Record<string, unknown>;
|
|
919
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
920
|
+
}[] | undefined;
|
|
921
|
+
batchSize?: number | undefined;
|
|
922
|
+
flushInterval?: number | undefined;
|
|
923
|
+
maxRetries?: number | undefined;
|
|
924
|
+
retryDelay?: number | undefined;
|
|
925
|
+
username?: string | undefined;
|
|
926
|
+
avatarUrl?: string | undefined;
|
|
927
|
+
embedColors?: Record<string, number> | undefined;
|
|
928
|
+
includeTimestamp?: boolean | undefined;
|
|
929
|
+
includeMeta?: boolean | undefined;
|
|
930
|
+
maxEmbedFields?: number | undefined;
|
|
931
|
+
} | {
|
|
932
|
+
webhookUrl: string;
|
|
933
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
934
|
+
rules?: {
|
|
935
|
+
match: Record<string, unknown>;
|
|
936
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
937
|
+
}[] | undefined;
|
|
938
|
+
batchSize?: number | undefined;
|
|
939
|
+
flushInterval?: number | undefined;
|
|
940
|
+
maxRetries?: number | undefined;
|
|
941
|
+
retryDelay?: number | undefined;
|
|
942
|
+
username?: string | undefined;
|
|
943
|
+
avatarUrl?: string | undefined;
|
|
944
|
+
embedColors?: Record<string, number> | undefined;
|
|
945
|
+
includeTimestamp?: boolean | undefined;
|
|
946
|
+
includeMeta?: boolean | undefined;
|
|
947
|
+
maxEmbedFields?: number | undefined;
|
|
948
|
+
}[] | undefined;
|
|
949
|
+
telegram?: {
|
|
950
|
+
botToken: string;
|
|
951
|
+
chatId: string | number;
|
|
952
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
953
|
+
rules?: {
|
|
954
|
+
match: Record<string, unknown>;
|
|
955
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
956
|
+
}[] | undefined;
|
|
957
|
+
batchSize?: number | undefined;
|
|
958
|
+
flushInterval?: number | undefined;
|
|
959
|
+
maxRetries?: number | undefined;
|
|
960
|
+
retryDelay?: number | undefined;
|
|
961
|
+
parseMode?: "Markdown" | "MarkdownV2" | "HTML" | undefined;
|
|
962
|
+
disableNotification?: boolean | undefined;
|
|
963
|
+
threadId?: number | undefined;
|
|
964
|
+
replyToMessageId?: number | undefined;
|
|
965
|
+
} | {
|
|
966
|
+
botToken: string;
|
|
967
|
+
chatId: string | number;
|
|
968
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
969
|
+
rules?: {
|
|
970
|
+
match: Record<string, unknown>;
|
|
971
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
972
|
+
}[] | undefined;
|
|
973
|
+
batchSize?: number | undefined;
|
|
974
|
+
flushInterval?: number | undefined;
|
|
975
|
+
maxRetries?: number | undefined;
|
|
976
|
+
retryDelay?: number | undefined;
|
|
977
|
+
parseMode?: "Markdown" | "MarkdownV2" | "HTML" | undefined;
|
|
978
|
+
disableNotification?: boolean | undefined;
|
|
979
|
+
threadId?: number | undefined;
|
|
980
|
+
replyToMessageId?: number | undefined;
|
|
981
|
+
}[] | undefined;
|
|
982
|
+
cloudwatch?: {
|
|
983
|
+
logGroupName: string;
|
|
984
|
+
logStreamName: string;
|
|
985
|
+
region: string;
|
|
986
|
+
accessKeyId: string;
|
|
987
|
+
secretAccessKey: string;
|
|
988
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
989
|
+
rules?: {
|
|
990
|
+
match: Record<string, unknown>;
|
|
991
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
992
|
+
}[] | undefined;
|
|
993
|
+
batchSize?: number | undefined;
|
|
994
|
+
flushInterval?: number | undefined;
|
|
995
|
+
maxRetries?: number | undefined;
|
|
996
|
+
retryDelay?: number | undefined;
|
|
997
|
+
createLogGroup?: boolean | undefined;
|
|
998
|
+
createLogStream?: boolean | undefined;
|
|
999
|
+
} | {
|
|
1000
|
+
logGroupName: string;
|
|
1001
|
+
logStreamName: string;
|
|
1002
|
+
region: string;
|
|
1003
|
+
accessKeyId: string;
|
|
1004
|
+
secretAccessKey: string;
|
|
1005
|
+
level?: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly" | undefined;
|
|
1006
|
+
rules?: {
|
|
1007
|
+
match: Record<string, unknown>;
|
|
1008
|
+
level: "off" | "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
1009
|
+
}[] | undefined;
|
|
1010
|
+
batchSize?: number | undefined;
|
|
1011
|
+
flushInterval?: number | undefined;
|
|
1012
|
+
maxRetries?: number | undefined;
|
|
1013
|
+
retryDelay?: number | undefined;
|
|
1014
|
+
createLogGroup?: boolean | undefined;
|
|
1015
|
+
createLogStream?: boolean | undefined;
|
|
1016
|
+
}[] | undefined;
|
|
1017
|
+
}>;
|
|
1018
|
+
|
|
1019
|
+
export { BaseHttpTransport, type BaseHttpTransportOptions, type BufferOptions, type BufferedMessage, type CloudWatchConfig, CloudWatchConfigSchema, CloudWatchTransport, type ConsoleConfig, ConsoleConfigSchema, type DiscordConfig, DiscordConfigSchema, DiscordTransport, type FileConfig, FileConfigSchema, type HttpTransportBaseConfig, HttpTransportBaseConfigSchema, LOG_LEVELS, type LevelConfig, type LevelConfigObject, LevelConfigObjectSchema, LevelConfigSchema, type LevelOverride, type LevelOverrideMatch, type LevelRule, LevelRuleSchema, type LogFormat, LogFormatSchema, type LogLevel, LogLevelSchema, Logger, type LoggerConfig, LoggerConfigSchema, type LoggerContext, LoggerStore, type MaskSecretsOptions, MessageBuffer, type Meta, type RequestIdOptions, type SingletonLogger, type TelegramConfig, TelegramConfigSchema, TelegramTransport, type TimingResult, assertLogLevel, createMasker, createSingletonLogger, extractRequestId, flattenObject, formatLogfmt, formatLogfmtValue, generateRequestId, getOrGenerateRequestId, isValidLogLevel, maskSecrets, matchesContext, measureAsync, measureSync, safeValidateConfig, validateConfig };
|