@spfn/core 0.1.0-alpha.88 → 0.2.0-beta.2

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.
Files changed (71) hide show
  1. package/README.md +1046 -384
  2. package/dist/boss-D-fGtVgM.d.ts +187 -0
  3. package/dist/cache/index.d.ts +13 -33
  4. package/dist/cache/index.js +14 -703
  5. package/dist/cache/index.js.map +1 -1
  6. package/dist/codegen/index.d.ts +167 -17
  7. package/dist/codegen/index.js +76 -1419
  8. package/dist/codegen/index.js.map +1 -1
  9. package/dist/config/index.d.ts +1191 -0
  10. package/dist/config/index.js +264 -0
  11. package/dist/config/index.js.map +1 -0
  12. package/dist/db/index.d.ts +728 -59
  13. package/dist/db/index.js +1028 -1225
  14. package/dist/db/index.js.map +1 -1
  15. package/dist/env/index.d.ts +579 -308
  16. package/dist/env/index.js +438 -930
  17. package/dist/env/index.js.map +1 -1
  18. package/dist/errors/index.d.ts +417 -29
  19. package/dist/errors/index.js +359 -98
  20. package/dist/errors/index.js.map +1 -1
  21. package/dist/event/index.d.ts +108 -0
  22. package/dist/event/index.js +122 -0
  23. package/dist/event/index.js.map +1 -0
  24. package/dist/job/index.d.ts +172 -0
  25. package/dist/job/index.js +361 -0
  26. package/dist/job/index.js.map +1 -0
  27. package/dist/logger/index.d.ts +20 -79
  28. package/dist/logger/index.js +82 -387
  29. package/dist/logger/index.js.map +1 -1
  30. package/dist/middleware/index.d.ts +2 -11
  31. package/dist/middleware/index.js +49 -703
  32. package/dist/middleware/index.js.map +1 -1
  33. package/dist/nextjs/index.d.ts +120 -0
  34. package/dist/nextjs/index.js +416 -0
  35. package/dist/nextjs/index.js.map +1 -0
  36. package/dist/{client/nextjs/index.d.ts → nextjs/server.d.ts} +288 -262
  37. package/dist/nextjs/server.js +568 -0
  38. package/dist/nextjs/server.js.map +1 -0
  39. package/dist/route/index.d.ts +686 -25
  40. package/dist/route/index.js +440 -1287
  41. package/dist/route/index.js.map +1 -1
  42. package/dist/route/types.d.ts +38 -0
  43. package/dist/route/types.js +3 -0
  44. package/dist/route/types.js.map +1 -0
  45. package/dist/server/index.d.ts +201 -67
  46. package/dist/server/index.js +921 -3182
  47. package/dist/server/index.js.map +1 -1
  48. package/dist/types-BGl4QL1w.d.ts +77 -0
  49. package/dist/types-DRG2XMTR.d.ts +157 -0
  50. package/package.json +52 -47
  51. package/dist/auto-loader-JFaZ9gON.d.ts +0 -80
  52. package/dist/client/index.d.ts +0 -358
  53. package/dist/client/index.js +0 -357
  54. package/dist/client/index.js.map +0 -1
  55. package/dist/client/nextjs/index.js +0 -371
  56. package/dist/client/nextjs/index.js.map +0 -1
  57. package/dist/codegen/generators/index.d.ts +0 -19
  58. package/dist/codegen/generators/index.js +0 -1404
  59. package/dist/codegen/generators/index.js.map +0 -1
  60. package/dist/database-errors-BNNmLTJE.d.ts +0 -86
  61. package/dist/events/index.d.ts +0 -183
  62. package/dist/events/index.js +0 -77
  63. package/dist/events/index.js.map +0 -1
  64. package/dist/index-DHiAqhKv.d.ts +0 -101
  65. package/dist/index.d.ts +0 -8
  66. package/dist/index.js +0 -3674
  67. package/dist/index.js.map +0 -1
  68. package/dist/types/index.d.ts +0 -121
  69. package/dist/types/index.js +0 -38
  70. package/dist/types/index.js.map +0 -1
  71. package/dist/types-BXibIEyj.d.ts +0 -60
@@ -1,6 +1,3 @@
1
- import { existsSync, mkdirSync, createWriteStream, statSync, readdirSync, renameSync, unlinkSync, accessSync, constants, writeFileSync } from 'fs';
2
- import { join } from 'path';
3
-
4
1
  // src/logger/types.ts
5
2
  var LOG_LEVEL_PRIORITY = {
6
3
  debug: 0,
@@ -44,27 +41,31 @@ function isSensitiveKey(key) {
44
41
  const lowerKey = key.toLowerCase();
45
42
  return SENSITIVE_KEYS.some((sensitive) => lowerKey.includes(sensitive));
46
43
  }
47
- function maskSensitiveData(data) {
44
+ function maskSensitiveData(data, seen = /* @__PURE__ */ new WeakSet()) {
48
45
  if (data === null || data === void 0) {
49
46
  return data;
50
47
  }
51
- if (Array.isArray(data)) {
52
- return data.map((item) => maskSensitiveData(item));
48
+ if (typeof data !== "object") {
49
+ return data;
53
50
  }
54
- if (typeof data === "object") {
55
- const masked = {};
56
- for (const [key, value] of Object.entries(data)) {
57
- if (isSensitiveKey(key)) {
58
- masked[key] = MASKED_VALUE;
59
- } else if (typeof value === "object" && value !== null) {
60
- masked[key] = maskSensitiveData(value);
61
- } else {
62
- masked[key] = value;
63
- }
51
+ if (seen.has(data)) {
52
+ return "[Circular]";
53
+ }
54
+ seen.add(data);
55
+ if (Array.isArray(data)) {
56
+ return data.map((item) => maskSensitiveData(item, seen));
57
+ }
58
+ const masked = {};
59
+ for (const [key, value] of Object.entries(data)) {
60
+ if (isSensitiveKey(key)) {
61
+ masked[key] = MASKED_VALUE;
62
+ } else if (typeof value === "object" && value !== null) {
63
+ masked[key] = maskSensitiveData(value, seen);
64
+ } else {
65
+ masked[key] = value;
64
66
  }
65
- return masked;
66
67
  }
67
- return data;
68
+ return masked;
68
69
  }
69
70
  var COLORS = {
70
71
  reset: "\x1B[0m",
@@ -84,9 +85,6 @@ var COLORS = {
84
85
  // 추가 컬러
85
86
  gray: "\x1B[90m"
86
87
  };
87
- function formatTimestamp(date) {
88
- return date.toISOString();
89
- }
90
88
  function formatTimestampHuman(date) {
91
89
  const year = date.getFullYear();
92
90
  const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -114,6 +112,12 @@ function formatConsole(metadata, colorize = true) {
114
112
  } else {
115
113
  parts.push(`[${timestamp}]`);
116
114
  }
115
+ const pid = process.pid;
116
+ if (colorize) {
117
+ parts.push(`${COLORS.dim}[pid=${pid}]${COLORS.reset}`);
118
+ } else {
119
+ parts.push(`[pid=${pid}]`);
120
+ }
117
121
  if (metadata.module) {
118
122
  if (colorize) {
119
123
  parts.push(`${COLORS.dim}[module=${metadata.module}]${COLORS.reset}`);
@@ -160,27 +164,6 @@ function formatConsole(metadata, colorize = true) {
160
164
  }
161
165
  return output;
162
166
  }
163
- function formatJSON(metadata) {
164
- const obj = {
165
- timestamp: formatTimestamp(metadata.timestamp),
166
- level: metadata.level,
167
- message: metadata.message
168
- };
169
- if (metadata.module) {
170
- obj.module = metadata.module;
171
- }
172
- if (metadata.context) {
173
- obj.context = metadata.context;
174
- }
175
- if (metadata.error) {
176
- obj.error = {
177
- name: metadata.error.name,
178
- message: metadata.error.message,
179
- stack: metadata.error.stack
180
- };
181
- }
182
- return JSON.stringify(obj);
183
- }
184
167
 
185
168
  // src/logger/logger.ts
186
169
  var Logger = class _Logger {
@@ -190,6 +173,29 @@ var Logger = class _Logger {
190
173
  this.config = config;
191
174
  this.module = config.module;
192
175
  }
176
+ /**
177
+ * Convert unknown error to Error object
178
+ */
179
+ toError(error) {
180
+ if (error instanceof Error) return error;
181
+ if (typeof error === "string") return new Error(error);
182
+ if (typeof error === "object" && error !== null) {
183
+ return new Error(JSON.stringify(error));
184
+ }
185
+ return new Error(String(error));
186
+ }
187
+ /**
188
+ * Check if value is a context object (not an error)
189
+ */
190
+ isContext(value) {
191
+ if (typeof value !== "object" || value === null) return false;
192
+ if (value instanceof Error) return false;
193
+ const hasStack = "stack" in value && typeof value.stack === "string";
194
+ if (hasStack) {
195
+ return false;
196
+ }
197
+ return true;
198
+ }
193
199
  /**
194
200
  * Get current log level
195
201
  */
@@ -206,37 +212,33 @@ var Logger = class _Logger {
206
212
  });
207
213
  }
208
214
  /**
209
- * Debug log
210
- */
211
- debug(message, context) {
212
- this.log("debug", message, void 0, context);
213
- }
214
- /**
215
- * Info log
215
+ * Common log method with error/context detection
216
216
  */
217
- info(message, context) {
218
- this.log("info", message, void 0, context);
219
- }
220
- warn(message, errorOrContext, context) {
217
+ logWithLevel(level, message, errorOrContext, context) {
221
218
  if (errorOrContext instanceof Error) {
222
- this.log("warn", message, errorOrContext, context);
219
+ this.log(level, message, errorOrContext, context);
220
+ } else if (errorOrContext !== void 0 && typeof errorOrContext === "object" && !this.isContext(errorOrContext)) {
221
+ this.log(level, message, this.toError(errorOrContext), context);
222
+ } else if (typeof errorOrContext === "string" || typeof errorOrContext === "number" || typeof errorOrContext === "boolean") {
223
+ this.log(level, message, this.toError(errorOrContext), context);
223
224
  } else {
224
- this.log("warn", message, void 0, errorOrContext);
225
+ this.log(level, message, void 0, errorOrContext);
225
226
  }
226
227
  }
228
+ debug(message, errorOrContext, context) {
229
+ this.logWithLevel("debug", message, errorOrContext, context);
230
+ }
231
+ info(message, errorOrContext, context) {
232
+ this.logWithLevel("info", message, errorOrContext, context);
233
+ }
234
+ warn(message, errorOrContext, context) {
235
+ this.logWithLevel("warn", message, errorOrContext, context);
236
+ }
227
237
  error(message, errorOrContext, context) {
228
- if (errorOrContext instanceof Error) {
229
- this.log("error", message, errorOrContext, context);
230
- } else {
231
- this.log("error", message, void 0, errorOrContext);
232
- }
238
+ this.logWithLevel("error", message, errorOrContext, context);
233
239
  }
234
240
  fatal(message, errorOrContext, context) {
235
- if (errorOrContext instanceof Error) {
236
- this.log("fatal", message, errorOrContext, context);
237
- } else {
238
- this.log("fatal", message, void 0, errorOrContext);
239
- }
241
+ this.logWithLevel("fatal", message, errorOrContext, context);
240
242
  }
241
243
  /**
242
244
  * Log processing (internal)
@@ -314,218 +316,8 @@ var ConsoleTransport = class {
314
316
  }
315
317
  }
316
318
  };
317
- var FileTransport = class {
318
- name = "file";
319
- level;
320
- enabled;
321
- logDir;
322
- maxFileSize;
323
- maxFiles;
324
- currentStream = null;
325
- currentFilename = null;
326
- constructor(config) {
327
- this.level = config.level;
328
- this.enabled = config.enabled;
329
- this.logDir = config.logDir;
330
- this.maxFileSize = config.maxFileSize ?? 10 * 1024 * 1024;
331
- this.maxFiles = config.maxFiles ?? 10;
332
- if (!existsSync(this.logDir)) {
333
- mkdirSync(this.logDir, { recursive: true });
334
- }
335
- }
336
- async log(metadata) {
337
- if (!this.enabled) {
338
- return;
339
- }
340
- if (LOG_LEVEL_PRIORITY[metadata.level] < LOG_LEVEL_PRIORITY[this.level]) {
341
- return;
342
- }
343
- const message = formatJSON(metadata);
344
- const filename = this.getLogFilename(metadata.timestamp);
345
- if (this.currentFilename !== filename) {
346
- await this.rotateStream(filename);
347
- await this.cleanOldFiles();
348
- } else if (this.currentFilename) {
349
- await this.checkAndRotateBySize();
350
- }
351
- if (this.currentStream) {
352
- return new Promise((resolve, reject) => {
353
- this.currentStream.write(message + "\n", "utf-8", (error) => {
354
- if (error) {
355
- process.stderr.write(`[FileTransport] Failed to write log: ${error.message}
356
- `);
357
- reject(error);
358
- } else {
359
- resolve();
360
- }
361
- });
362
- });
363
- }
364
- }
365
- /**
366
- * 스트림 교체 (날짜 변경 시)
367
- */
368
- async rotateStream(filename) {
369
- if (this.currentStream) {
370
- await this.closeStream();
371
- }
372
- const filepath = join(this.logDir, filename);
373
- this.currentStream = createWriteStream(filepath, {
374
- flags: "a",
375
- // append mode
376
- encoding: "utf-8"
377
- });
378
- this.currentFilename = filename;
379
- this.currentStream.on("error", (error) => {
380
- process.stderr.write(`[FileTransport] Stream error: ${error.message}
381
- `);
382
- this.currentStream = null;
383
- this.currentFilename = null;
384
- });
385
- }
386
- /**
387
- * 현재 스트림 닫기
388
- */
389
- async closeStream() {
390
- if (!this.currentStream) {
391
- return;
392
- }
393
- return new Promise((resolve, reject) => {
394
- this.currentStream.end((error) => {
395
- if (error) {
396
- reject(error);
397
- } else {
398
- this.currentStream = null;
399
- this.currentFilename = null;
400
- resolve();
401
- }
402
- });
403
- });
404
- }
405
- /**
406
- * 파일 크기 체크 및 크기 기반 로테이션
407
- */
408
- async checkAndRotateBySize() {
409
- if (!this.currentFilename) {
410
- return;
411
- }
412
- const filepath = join(this.logDir, this.currentFilename);
413
- if (!existsSync(filepath)) {
414
- return;
415
- }
416
- try {
417
- const stats = statSync(filepath);
418
- if (stats.size >= this.maxFileSize) {
419
- await this.rotateBySize();
420
- }
421
- } catch (error) {
422
- const errorMessage = error instanceof Error ? error.message : String(error);
423
- process.stderr.write(`[FileTransport] Failed to check file size: ${errorMessage}
424
- `);
425
- }
426
- }
427
- /**
428
- * 크기 기반 로테이션 수행
429
- * 예: 2025-01-01.log -> 2025-01-01.1.log, 2025-01-01.1.log -> 2025-01-01.2.log
430
- */
431
- async rotateBySize() {
432
- if (!this.currentFilename) {
433
- return;
434
- }
435
- await this.closeStream();
436
- const baseName = this.currentFilename.replace(/\.log$/, "");
437
- const files = readdirSync(this.logDir);
438
- const relatedFiles = files.filter((file) => file.startsWith(baseName) && file.endsWith(".log")).sort().reverse();
439
- for (const file of relatedFiles) {
440
- const match = file.match(/\.(\d+)\.log$/);
441
- if (match) {
442
- const oldNum = parseInt(match[1], 10);
443
- const newNum = oldNum + 1;
444
- const oldPath = join(this.logDir, file);
445
- const newPath2 = join(this.logDir, `${baseName}.${newNum}.log`);
446
- try {
447
- renameSync(oldPath, newPath2);
448
- } catch (error) {
449
- const errorMessage = error instanceof Error ? error.message : String(error);
450
- process.stderr.write(`[FileTransport] Failed to rotate file: ${errorMessage}
451
- `);
452
- }
453
- }
454
- }
455
- const currentPath = join(this.logDir, this.currentFilename);
456
- const newPath = join(this.logDir, `${baseName}.1.log`);
457
- try {
458
- if (existsSync(currentPath)) {
459
- renameSync(currentPath, newPath);
460
- }
461
- } catch (error) {
462
- const errorMessage = error instanceof Error ? error.message : String(error);
463
- process.stderr.write(`[FileTransport] Failed to rotate current file: ${errorMessage}
464
- `);
465
- }
466
- await this.rotateStream(this.currentFilename);
467
- }
468
- /**
469
- * 오래된 로그 파일 정리
470
- * maxFiles 개수를 초과하는 로그 파일 삭제
471
- */
472
- async cleanOldFiles() {
473
- try {
474
- if (!existsSync(this.logDir)) {
475
- return;
476
- }
477
- const files = readdirSync(this.logDir);
478
- const logFiles = files.filter((file) => file.endsWith(".log")).map((file) => {
479
- const filepath = join(this.logDir, file);
480
- const stats = statSync(filepath);
481
- return { file, mtime: stats.mtime };
482
- }).sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
483
- if (logFiles.length > this.maxFiles) {
484
- const filesToDelete = logFiles.slice(this.maxFiles);
485
- for (const { file } of filesToDelete) {
486
- const filepath = join(this.logDir, file);
487
- try {
488
- unlinkSync(filepath);
489
- } catch (error) {
490
- const errorMessage = error instanceof Error ? error.message : String(error);
491
- process.stderr.write(`[FileTransport] Failed to delete old file "${file}": ${errorMessage}
492
- `);
493
- }
494
- }
495
- }
496
- } catch (error) {
497
- const errorMessage = error instanceof Error ? error.message : String(error);
498
- process.stderr.write(`[FileTransport] Failed to clean old files: ${errorMessage}
499
- `);
500
- }
501
- }
502
- /**
503
- * 날짜별 로그 파일명 생성
504
- */
505
- getLogFilename(date) {
506
- const year = date.getFullYear();
507
- const month = String(date.getMonth() + 1).padStart(2, "0");
508
- const day = String(date.getDate()).padStart(2, "0");
509
- return `${year}-${month}-${day}.log`;
510
- }
511
- async close() {
512
- await this.closeStream();
513
- }
514
- };
515
- function isFileLoggingEnabled() {
516
- return process.env.LOGGER_FILE_ENABLED === "true";
517
- }
518
- function getDefaultLogLevel() {
519
- const isProduction = process.env.NODE_ENV === "production";
520
- const isDevelopment = process.env.NODE_ENV === "development";
521
- if (isDevelopment) {
522
- return "debug";
523
- }
524
- if (isProduction) {
525
- return "info";
526
- }
527
- return "warn";
528
- }
319
+
320
+ // src/logger/config.ts
529
321
  function getConsoleConfig() {
530
322
  const isProduction = process.env.NODE_ENV === "production";
531
323
  return {
@@ -535,100 +327,6 @@ function getConsoleConfig() {
535
327
  // Dev: colored output, Production: plain text
536
328
  };
537
329
  }
538
- function getFileConfig() {
539
- const isProduction = process.env.NODE_ENV === "production";
540
- return {
541
- level: "info",
542
- enabled: isProduction,
543
- // File logging in production only
544
- logDir: process.env.LOG_DIR || "./logs",
545
- maxFileSize: 10 * 1024 * 1024,
546
- // 10MB
547
- maxFiles: 10
548
- };
549
- }
550
- function validateDirectoryWritable(dirPath) {
551
- if (!existsSync(dirPath)) {
552
- try {
553
- mkdirSync(dirPath, { recursive: true });
554
- } catch (error) {
555
- const errorMessage = error instanceof Error ? error.message : String(error);
556
- throw new Error(`Failed to create log directory "${dirPath}": ${errorMessage}`);
557
- }
558
- }
559
- try {
560
- accessSync(dirPath, constants.W_OK);
561
- } catch {
562
- throw new Error(`Log directory "${dirPath}" is not writable. Please check permissions.`);
563
- }
564
- const testFile = join(dirPath, ".logger-write-test");
565
- try {
566
- writeFileSync(testFile, "test", "utf-8");
567
- unlinkSync(testFile);
568
- } catch (error) {
569
- const errorMessage = error instanceof Error ? error.message : String(error);
570
- throw new Error(`Cannot write to log directory "${dirPath}": ${errorMessage}`);
571
- }
572
- }
573
- function validateFileConfig() {
574
- if (!isFileLoggingEnabled()) {
575
- return;
576
- }
577
- const logDir = process.env.LOG_DIR;
578
- if (!logDir) {
579
- throw new Error(
580
- "LOG_DIR environment variable is required when LOGGER_FILE_ENABLED=true. Example: LOG_DIR=/var/log/myapp"
581
- );
582
- }
583
- validateDirectoryWritable(logDir);
584
- }
585
- function validateSlackConfig() {
586
- const webhookUrl = process.env.SLACK_WEBHOOK_URL;
587
- if (!webhookUrl) {
588
- return;
589
- }
590
- if (!webhookUrl.startsWith("https://hooks.slack.com/")) {
591
- throw new Error(
592
- `Invalid SLACK_WEBHOOK_URL: "${webhookUrl}". Slack webhook URLs must start with "https://hooks.slack.com/"`
593
- );
594
- }
595
- }
596
- function validateEmailConfig() {
597
- const smtpHost = process.env.SMTP_HOST;
598
- const smtpPort = process.env.SMTP_PORT;
599
- const emailFrom = process.env.EMAIL_FROM;
600
- const emailTo = process.env.EMAIL_TO;
601
- const hasAnyEmailConfig = smtpHost || smtpPort || emailFrom || emailTo;
602
- if (!hasAnyEmailConfig) {
603
- return;
604
- }
605
- const missingFields = [];
606
- if (!smtpHost) missingFields.push("SMTP_HOST");
607
- if (!smtpPort) missingFields.push("SMTP_PORT");
608
- if (!emailFrom) missingFields.push("EMAIL_FROM");
609
- if (!emailTo) missingFields.push("EMAIL_TO");
610
- if (missingFields.length > 0) {
611
- throw new Error(
612
- `Email transport configuration incomplete. Missing: ${missingFields.join(", ")}. Either set all required fields or remove all email configuration.`
613
- );
614
- }
615
- const port = parseInt(smtpPort, 10);
616
- if (isNaN(port) || port < 1 || port > 65535) {
617
- throw new Error(
618
- `Invalid SMTP_PORT: "${smtpPort}". Must be a number between 1 and 65535.`
619
- );
620
- }
621
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
622
- if (!emailRegex.test(emailFrom)) {
623
- throw new Error(`Invalid EMAIL_FROM format: "${emailFrom}"`);
624
- }
625
- const recipients = emailTo.split(",").map((e) => e.trim());
626
- for (const email of recipients) {
627
- if (!emailRegex.test(email)) {
628
- throw new Error(`Invalid email address in EMAIL_TO: "${email}"`);
629
- }
630
- }
631
- }
632
330
  function validateEnvironment() {
633
331
  const nodeEnv = process.env.NODE_ENV;
634
332
  if (!nodeEnv) {
@@ -638,17 +336,7 @@ function validateEnvironment() {
638
336
  }
639
337
  }
640
338
  function validateConfig() {
641
- try {
642
- validateEnvironment();
643
- validateFileConfig();
644
- validateSlackConfig();
645
- validateEmailConfig();
646
- } catch (error) {
647
- if (error instanceof Error) {
648
- throw new Error(`[Logger] Configuration validation failed: ${error.message}`);
649
- }
650
- throw error;
651
- }
339
+ validateEnvironment();
652
340
  }
653
341
 
654
342
  // src/logger/factory.ts
@@ -656,16 +344,23 @@ function initializeTransports() {
656
344
  const transports = [];
657
345
  const consoleConfig = getConsoleConfig();
658
346
  transports.push(new ConsoleTransport(consoleConfig));
659
- const fileConfig = getFileConfig();
660
- if (fileConfig.enabled) {
661
- transports.push(new FileTransport(fileConfig));
662
- }
663
347
  return transports;
664
348
  }
349
+ function getLogLevel() {
350
+ const envLevel = process.env.SPFN_LOG_LEVEL || process.env.NEXT_PUBLIC_SPFN_LOG_LEVEL || "info";
351
+ if (envLevel in LOG_LEVEL_PRIORITY) {
352
+ return envLevel;
353
+ }
354
+ process.stderr.write(
355
+ `[Logger] Invalid log level "${envLevel}", defaulting to "info"
356
+ `
357
+ );
358
+ return "info";
359
+ }
665
360
  function initializeLogger() {
666
361
  validateConfig();
667
362
  return new Logger({
668
- level: getDefaultLogLevel(),
363
+ level: getLogLevel(),
669
364
  transports: initializeTransports()
670
365
  });
671
366
  }