@wgtechlabs/log-engine 2.2.2-dev.c977791 → 2.2.2-dev.f8ac7bb

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 (50) hide show
  1. package/README.md +205 -1
  2. package/dist/cjs/formatter/emoji-data.cjs +87 -0
  3. package/dist/cjs/formatter/emoji-data.d.ts +18 -0
  4. package/dist/cjs/formatter/emoji-data.d.ts.map +1 -0
  5. package/dist/cjs/formatter/emoji-data.js.map +1 -0
  6. package/dist/cjs/formatter/emoji-selector.cjs +209 -0
  7. package/dist/cjs/formatter/emoji-selector.d.ts +74 -0
  8. package/dist/cjs/formatter/emoji-selector.d.ts.map +1 -0
  9. package/dist/cjs/formatter/emoji-selector.js.map +1 -0
  10. package/dist/cjs/formatter/index.cjs +6 -1
  11. package/dist/cjs/formatter/index.d.ts +2 -0
  12. package/dist/cjs/formatter/index.d.ts.map +1 -1
  13. package/dist/cjs/formatter/index.js.map +1 -1
  14. package/dist/cjs/formatter/message-formatter.cjs +11 -2
  15. package/dist/cjs/formatter/message-formatter.d.ts.map +1 -1
  16. package/dist/cjs/formatter/message-formatter.js.map +1 -1
  17. package/dist/cjs/index.cjs +5 -1
  18. package/dist/cjs/index.d.ts +2 -1
  19. package/dist/cjs/index.d.ts.map +1 -1
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/logger/core.cjs +10 -0
  22. package/dist/cjs/logger/core.d.ts.map +1 -1
  23. package/dist/cjs/logger/core.js.map +1 -1
  24. package/dist/cjs/types/index.d.ts +29 -0
  25. package/dist/cjs/types/index.d.ts.map +1 -1
  26. package/dist/esm/formatter/emoji-data.d.ts +18 -0
  27. package/dist/esm/formatter/emoji-data.d.ts.map +1 -0
  28. package/dist/esm/formatter/emoji-data.js +84 -0
  29. package/dist/esm/formatter/emoji-data.js.map +1 -0
  30. package/dist/esm/formatter/emoji-selector.d.ts +74 -0
  31. package/dist/esm/formatter/emoji-selector.d.ts.map +1 -0
  32. package/dist/esm/formatter/emoji-selector.js +205 -0
  33. package/dist/esm/formatter/emoji-selector.js.map +1 -0
  34. package/dist/esm/formatter/index.d.ts +2 -0
  35. package/dist/esm/formatter/index.d.ts.map +1 -1
  36. package/dist/esm/formatter/index.js +2 -0
  37. package/dist/esm/formatter/index.js.map +1 -1
  38. package/dist/esm/formatter/message-formatter.d.ts.map +1 -1
  39. package/dist/esm/formatter/message-formatter.js +11 -2
  40. package/dist/esm/formatter/message-formatter.js.map +1 -1
  41. package/dist/esm/index.d.ts +2 -1
  42. package/dist/esm/index.d.ts.map +1 -1
  43. package/dist/esm/index.js +1 -0
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/logger/core.d.ts.map +1 -1
  46. package/dist/esm/logger/core.js +11 -1
  47. package/dist/esm/logger/core.js.map +1 -1
  48. package/dist/esm/types/index.d.ts +29 -0
  49. package/dist/esm/types/index.d.ts.map +1 -1
  50. package/package.json +3 -2
package/README.md CHANGED
@@ -16,6 +16,7 @@ Log Engine transforms your development experience from chaotic debugging session
16
16
 
17
17
  ## ✨ Key Features
18
18
 
19
+ - **🎨 Context-Aware Emoji (New!)**: Intelligent emoji support that enhances log readability by analyzing content and automatically selecting relevant visual indicators - based on the gitmoji set with 37 curated mappings and fully customizable.
19
20
  - **🔒 Advanced Data Redaction (Enhanced!)**: Built-in PII protection with **custom regex patterns**, **dynamic field management**, and **environment-based configuration** - the first logging library with comprehensive security-first logging by default.
20
21
  - **đŸŽ¯ Configurable Output Handlers (New!)**: Revolutionary output routing system supporting **custom destinations**, **multiple simultaneous outputs**, and **production-ready handlers** - redirect logs to files, HTTP endpoints, GUI applications, testing frameworks, or any custom destination with zero configuration complexity.
21
22
  - **⚡ Custom Redaction Patterns**: Add your own regex patterns for advanced field detection and enterprise-specific data protection requirements.
@@ -29,6 +30,7 @@ Log Engine transforms your development experience from chaotic debugging session
29
30
  - **âš™ī¸ Auto-Configuration**: Intelligent environment-based setup using NODE_ENV variables. No config files, initialization scripts, or manual setup - Log Engine works perfectly out of the box.
30
31
  - **✨ Enhanced Formatting**: Structured log entries with dual timestamps (ISO + human-readable) and colored level indicators for maximum readability.
31
32
  - **🔗 Zero Dependencies**: No external dependencies for maximum compatibility and security - keeps your bundle clean and your project simple.
33
+ - **📏 Size Monitoring**: Automated bundle size checking ensures the package stays under 1MB to maintain its lightweight promise.
32
34
  - **🔌 Easy Integration**: Simple API that works seamlessly with existing Node.js applications. Just `import` and start logging - no middleware, plugins, or configuration required.
33
35
 
34
36
  ## âš ī¸ Breaking Changes Notice
@@ -413,6 +415,207 @@ LogEngine.error('Connection failed');
413
415
 
414
416
  **Note**: Log levels (`[DEBUG]`, `[INFO]`, `[WARN]`, `[ERROR]`, `[LOG]`) are always included regardless of configuration to maintain log clarity and filtering capabilities.
415
417
 
418
+ ## 🎨 Context-Aware Emoji Support
419
+
420
+ **LogEngine features intelligent emoji support that enhances log readability by adding visual context to each log message.** The emoji engine analyzes your log content (level + message + data) and automatically selects the most relevant emoji, making it easier to visually parse large logs and instantly identify the type of each log line.
421
+
422
+ ### Features
423
+
424
+ - **đŸŽ¯ Context-Aware Selection**: Automatically analyzes message content and data to select appropriate emoji
425
+ - **đŸ“Ļ Rich Emoji Set**: Based on [gitmoji](https://gitmoji.dev) with 40+ curated emoji mappings
426
+ - **🔄 Smart Fallback**: Uses level-specific emoji when no context match is found
427
+ - **đŸ› ī¸ Fully Customizable**: Extend or override emoji mappings and fallback behavior
428
+ - **✅ Enabled by Default**: Emoji are automatically included in logs (can be disabled via `includeEmoji: false`)
429
+
430
+ ### Quick Start
431
+
432
+ ```typescript
433
+ import { LogEngine } from '@wgtechlabs/log-engine';
434
+
435
+ // Emoji are enabled by default - just start logging!
436
+ LogEngine.error('Database connection failed');
437
+ // Output: [2026-02-11T14:00:00.000Z][2:00PM][ERROR][đŸ—ƒī¸]: Database connection failed
438
+
439
+ LogEngine.info('Deployed to production successfully');
440
+ // Output: [2026-02-11T14:00:01.000Z][2:00PM][INFO][🚀]: Deployed to production successfully
441
+
442
+ LogEngine.warn('Performance degradation detected');
443
+ // Output: [2026-02-11T14:00:02.000Z][2:00PM][WARN][âšĄī¸]: Performance degradation detected
444
+
445
+ LogEngine.info('Unknown event happened');
446
+ // Output: [2026-02-11T14:00:03.000Z][2:00PM][INFO][â„šī¸]: Unknown event happened (fallback)
447
+
448
+ // Disable emoji if needed
449
+ LogEngine.configure({
450
+ format: {
451
+ includeEmoji: false
452
+ }
453
+ });
454
+ ```
455
+
456
+ ### Context-Aware Emoji Mappings
457
+
458
+ LogEngine intelligently matches keywords in your log messages to select appropriate emoji:
459
+
460
+ | Context | Keywords | Emoji | Example |
461
+ |---------|----------|-------|---------|
462
+ | **Database** | database, db, sql, query, mongo, postgres | đŸ—ƒī¸ | "Database query failed" |
463
+ | **Deployment** | deploy, release, launched, production | 🚀 | "Deployed to production" |
464
+ | **Performance** | performance, speed, optimize, latency | âšĄī¸ | "Performance issues detected" |
465
+ | **Security** | security, vulnerability, auth, permission | đŸ”’ī¸ | "Security breach detected" |
466
+ | **Critical** | critical, urgent, emergency, crash | đŸš‘ī¸ | "Critical system failure" |
467
+ | **Bugs** | bug, fix, defect, issue | 🐛 | "Fixed bug in login" |
468
+ | **Network** | network, http, api, endpoint | 🌐 | "API request failed" |
469
+ | **Testing** | tests, testing, validation | ✅ | "All tests passed" |
470
+
471
+ ### Fallback Emoji by Level
472
+
473
+ When no context-specific emoji matches, LogEngine uses these fallback emoji:
474
+
475
+ | Log Level | Emoji | Description |
476
+ |-----------|-------|-------------|
477
+ | `DEBUG` | 🐞 | Debugging information |
478
+ | `INFO` | â„šī¸ | General information |
479
+ | `WARN` | âš ī¸ | Warning messages |
480
+ | `ERROR` | ❌ | Error messages |
481
+ | `LOG` | ✅ | Critical log messages |
482
+
483
+ ### Custom Emoji Configuration
484
+
485
+ #### Custom Context Mappings
486
+
487
+ Add your own emoji mappings for custom contexts:
488
+
489
+ ```typescript
490
+ LogEngine.configure({
491
+ format: {
492
+ emoji: {
493
+ customMappings: [
494
+ {
495
+ emoji: 'đŸŽ¯',
496
+ code: ':dart:',
497
+ description: 'Goal achieved',
498
+ keywords: ['goal', 'target', 'achieved', 'milestone']
499
+ },
500
+ {
501
+ emoji: '💰',
502
+ code: ':moneybag:',
503
+ description: 'Payment operations',
504
+ keywords: ['payment', 'transaction', 'billing', 'invoice']
505
+ }
506
+ ]
507
+ }
508
+ }
509
+ });
510
+
511
+ LogEngine.info('Payment processed successfully');
512
+ // Output: [INFO][💰]: Payment processed successfully
513
+
514
+ LogEngine.info('Sales target achieved');
515
+ // Output: [INFO][đŸŽ¯]: Sales target achieved
516
+ ```
517
+
518
+ #### Custom Fallback Emoji
519
+
520
+ Override the default fallback emoji for each log level:
521
+
522
+ ```typescript
523
+ LogEngine.configure({
524
+ format: {
525
+ emoji: {
526
+ customFallbacks: {
527
+ DEBUG: '🔍',
528
+ INFO: 'đŸ“ĸ',
529
+ WARN: '🚨',
530
+ ERROR: '💀',
531
+ LOG: '🎉'
532
+ }
533
+ }
534
+ }
535
+ });
536
+
537
+ LogEngine.info('Generic info message');
538
+ // Output: [INFO][đŸ“ĸ]: Generic info message
539
+ ```
540
+
541
+ #### Use Custom Mappings Exclusively
542
+
543
+ Use only your custom mappings and ignore the built-in set:
544
+
545
+ ```typescript
546
+ LogEngine.configure({
547
+ format: {
548
+ emoji: {
549
+ useCustomOnly: true,
550
+ customMappings: [
551
+ // Your custom mappings only
552
+ ]
553
+ }
554
+ }
555
+ });
556
+ ```
557
+
558
+ ### Data Context Analysis
559
+
560
+ The emoji selector also analyzes data objects for context:
561
+
562
+ ```typescript
563
+ LogEngine.info('Operation completed', {
564
+ database: 'postgres',
565
+ table: 'users',
566
+ rows: 1000
567
+ });
568
+ // Output: [INFO][đŸ—ƒī¸]: Operation completed { database: 'postgres', ... }
569
+
570
+ LogEngine.warn('Issue detected', {
571
+ performance: 'degraded',
572
+ latency: '500ms'
573
+ });
574
+ // Output: [WARN][âšĄī¸]: Issue detected { performance: 'degraded', ... }
575
+ ```
576
+
577
+ ### Programmatic Access
578
+
579
+ Access emoji utilities directly for advanced use cases:
580
+
581
+ ```typescript
582
+ import { EmojiSelector, EMOJI_MAPPINGS, FALLBACK_EMOJI } from '@wgtechlabs/log-engine';
583
+
584
+ // Check all available emoji mappings
585
+ console.log(EMOJI_MAPPINGS);
586
+ // [{ emoji: '🐛', code: ':bug:', description: 'Fix a bug', keywords: [...] }, ...]
587
+
588
+ // Check fallback emoji
589
+ console.log(FALLBACK_EMOJI);
590
+ // { DEBUG: '🐞', INFO: 'â„šī¸', WARN: 'âš ī¸', ERROR: '❌', LOG: '✅' }
591
+
592
+ // Configure emoji selector directly (for customization)
593
+ EmojiSelector.configure({
594
+ customMappings: [...]
595
+ });
596
+ ```
597
+
598
+ ### Output Format
599
+
600
+ With emoji (enabled by default), the log format is:
601
+
602
+ ```
603
+ [ISO_TIMESTAMP][LOCAL_TIME][LEVEL][EMOJI]: message [data]
604
+ ```
605
+
606
+ Example:
607
+ ```
608
+ [2026-02-11T14:00:00.000Z][2:00PM][ERROR][đŸ—ƒī¸]: Database connection failed
609
+ ```
610
+
611
+ ### Benefits
612
+
613
+ - **đŸ‘ī¸ Visual Clarity**: Instantly identify log context at a glance
614
+ - **đŸŽ¯ Better Debugging**: Quickly locate specific types of logs in large outputs
615
+ - **🎨 Enhanced UX**: More engaging and pleasant logging experience
616
+ - **🔧 Flexible**: Fully customizable to match your project's needs
617
+ - **🔒 Compatibility Note**: Enabled by default – existing log output will include emojis; disable or customize emoji behavior via configuration to preserve prior formats
618
+
416
619
  ## 🔒 Advanced Data Redaction
417
620
 
418
621
  **LogEngine features comprehensive built-in PII protection with advanced customization capabilities that automatically redacts sensitive information from your logs.** This security-first approach prevents accidental exposure of passwords, tokens, emails, and other sensitive data while maintaining full debugging capabilities with enterprise-grade flexibility.
@@ -901,7 +1104,8 @@ Contributions are welcome, create a pull request to this repo and I will review
901
1104
  - `pnpm lint:security` - Run security-focused linting
902
1105
  - `pnpm secure` - Run comprehensive security checks
903
1106
  - `pnpm build` - Build the TypeScript project
904
- - `pnpm validate` - Run full validation (lint + test + build)
1107
+ - `pnpm size:check` - Check bundle size to maintain lightweight feature
1108
+ - `pnpm validate` - Run full validation (lint + test + build + size check)
905
1109
 
906
1110
  Read the project's [contributing guide](./CONTRIBUTING.md) for detailed development setup, testing guidelines, and contribution requirements.
907
1111
 
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ /**
3
+ * Emoji data for context-aware logging
4
+ * Based on gitmoji.dev emoji set
5
+ * Each entry maps emoji to keywords that help identify when to use it
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.FALLBACK_EMOJI = exports.EMOJI_MAPPINGS = void 0;
9
+ /**
10
+ * Curated emoji mappings for context-aware logging
11
+ * Based on the gitmoji set from https://gitmoji.dev
12
+ * Ordered by specificity - more specific keywords first
13
+ */
14
+ exports.EMOJI_MAPPINGS = [
15
+ // More specific contexts first
16
+ // Database (specific)
17
+ { emoji: 'đŸ—ƒī¸', code: ':card_file_box:', description: 'Database related', keywords: ['database', 'db', 'sql', 'query', 'table', 'schema', 'migration', 'mongo', 'postgres', 'mysql'] },
18
+ // Deployment and releases (specific)
19
+ { emoji: '🚀', code: ':rocket:', description: 'Deploy or release', keywords: ['deploy', 'deployed', 'deployment', 'release', 'launched', 'production'] },
20
+ // Performance (specific)
21
+ { emoji: 'âšĄī¸', code: ':zap:', description: 'Improve performance', keywords: ['performance', 'speed', 'optimize', 'fast', 'slow', 'latency', 'throughput'] },
22
+ // Security (specific)
23
+ { emoji: 'đŸ”’ī¸', code: ':lock:', description: 'Fix security issues', keywords: ['security', 'secure', 'vulnerability', 'exploit', 'auth', 'authentication', 'authorization', 'permission'] },
24
+ // Critical issues (specific)
25
+ { emoji: 'đŸš‘ī¸', code: ':ambulance:', description: 'Critical hotfix', keywords: ['critical', 'hotfix', 'urgent', 'emergency', 'crash', 'fatal'] },
26
+ // Bugs and fixes (specific)
27
+ { emoji: '🐛', code: ':bug:', description: 'Fix a bug', keywords: ['bug', 'fix', 'fixed', 'fixing', 'defect', 'issue'] },
28
+ // Less specific/generic contexts last
29
+ // Errors and failures (generic)
30
+ { emoji: '❌', code: ':x:', description: 'Error or failure', keywords: ['error', 'fail', 'failed', 'failure', 'exception', 'reject'] },
31
+ { emoji: 'đŸ”Ĩ', code: ':fire:', description: 'Remove code or files', keywords: ['remove', 'delete', 'deprecated', 'obsolete'] },
32
+ { emoji: '🐌', code: ':snail:', description: 'Slow performance', keywords: ['timeout', 'hang', 'freeze'] },
33
+ { emoji: 'đŸ”“ī¸', code: ':unlock:', description: 'Unlock or access', keywords: ['unlock', 'access', 'grant', 'allow'] },
34
+ { emoji: '💾', code: ':floppy_disk:', description: 'Save or persist data', keywords: ['save', 'saved', 'saving', 'persist', 'write', 'store'] },
35
+ { emoji: '🎉', code: ':tada:', description: 'Initial commit or milestone', keywords: ['initial', 'milestone', 'celebrate', 'success', 'complete'] },
36
+ // Configuration
37
+ { emoji: '🔧', code: ':wrench:', description: 'Configuration changes', keywords: ['config', 'configuration', 'setting', 'settings', 'configure'] },
38
+ { emoji: 'âš™ī¸', code: ':gear:', description: 'Configuration or settings', keywords: ['setup', 'init', 'initialize'] },
39
+ // API and network
40
+ { emoji: '🌐', code: ':globe_with_meridians:', description: 'Network or internet', keywords: ['network', 'internet', 'http', 'https', 'request', 'response', 'api', 'endpoint'] },
41
+ { emoji: '🔌', code: ':electric_plug:', description: 'Connection or plugin', keywords: ['connect', 'connection', 'disconnect', 'plugin', 'integration'] },
42
+ // Testing
43
+ { emoji: '✅', code: ':white_check_mark:', description: 'Tests passing', keywords: ['tests', 'testing', 'pass', 'passed', 'validation', 'validate'] },
44
+ { emoji: 'đŸ§Ē', code: ':test_tube:', description: 'Running tests', keywords: ['experiment', 'trial', 'spec'] },
45
+ // Documentation
46
+ { emoji: '📝', code: ':memo:', description: 'Add or update documentation', keywords: ['document', 'documentation', 'docs', 'readme', 'comment'] },
47
+ { emoji: '💡', code: ':bulb:', description: 'New idea or insight', keywords: ['idea', 'insight', 'suggestion', 'tip', 'hint'] },
48
+ // Dependencies
49
+ { emoji: '➕', code: ':heavy_plus_sign:', description: 'Add dependency', keywords: ['add', 'added', 'adding', 'install', 'dependency', 'package'] },
50
+ { emoji: '➖', code: ':heavy_minus_sign:', description: 'Remove dependency', keywords: ['uninstall', 'removed'] },
51
+ { emoji: 'âŦ†ī¸', code: ':arrow_up:', description: 'Upgrade dependencies', keywords: ['upgrade', 'update', 'updated'] },
52
+ { emoji: 'âŦ‡ī¸', code: ':arrow_down:', description: 'Downgrade dependencies', keywords: ['downgrade', 'rollback'] },
53
+ // Files and structure
54
+ { emoji: 'đŸ“Ļ', code: ':package:', description: 'Update compiled files', keywords: ['package', 'build', 'compile', 'bundle'] },
55
+ { emoji: '🚚', code: ':truck:', description: 'Move or rename files', keywords: ['move', 'moved', 'rename', 'renamed', 'relocate'] },
56
+ // Work in progress
57
+ { emoji: '🚧', code: ':construction:', description: 'Work in progress', keywords: ['wip', 'progress', 'working', 'ongoing', 'incomplete'] },
58
+ // Breaking changes
59
+ { emoji: 'đŸ’Ĩ', code: ':boom:', description: 'Breaking changes', keywords: ['breaking', 'break', 'incompatible'] },
60
+ // Accessibility
61
+ { emoji: 'â™ŋī¸', code: ':wheelchair:', description: 'Improve accessibility', keywords: ['accessibility', 'a11y', 'accessible'] },
62
+ // Internationalization
63
+ { emoji: '🌍', code: ':earth_africa:', description: 'Internationalization', keywords: ['i18n', 'localization', 'l10n', 'translation', 'language'] },
64
+ // UI and styling
65
+ { emoji: '💄', code: ':lipstick:', description: 'Update UI and style', keywords: ['ui', 'style', 'css', 'design', 'interface', 'layout'] },
66
+ { emoji: '🎨', code: ':art:', description: 'Improve structure', keywords: ['refactor', 'refactoring', 'restructure', 'format'] },
67
+ // Logging and monitoring
68
+ { emoji: '🔊', code: ':loud_sound:', description: 'Add or update logs', keywords: ['logging', 'trace'] },
69
+ { emoji: '🔇', code: ':mute:', description: 'Remove logs', keywords: ['silent', 'quiet', 'mute'] },
70
+ { emoji: '📊', code: ':bar_chart:', description: 'Analytics or metrics', keywords: ['analytics', 'metrics', 'stats', 'statistics', 'monitor', 'monitoring'] },
71
+ // Code review
72
+ { emoji: '👌', code: ':ok_hand:', description: 'Code review changes', keywords: ['review', 'approve', 'approved', 'lgtm'] },
73
+ // Catch-all for new features (put last)
74
+ { emoji: '✨', code: ':sparkles:', description: 'New feature', keywords: ['feature', 'new', 'enhancement', 'improve', 'improved'] },
75
+ ];
76
+ /**
77
+ * Default fallback emoji for each log level
78
+ * These are used when no context-specific emoji matches
79
+ */
80
+ exports.FALLBACK_EMOJI = {
81
+ DEBUG: '🐞',
82
+ INFO: 'â„šī¸',
83
+ WARN: 'âš ī¸',
84
+ ERROR: '❌',
85
+ LOG: '✅'
86
+ };
87
+ //# sourceMappingURL=emoji-data.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Emoji data for context-aware logging
3
+ * Based on gitmoji.dev emoji set
4
+ * Each entry maps emoji to keywords that help identify when to use it
5
+ */
6
+ import { EmojiMapping } from '../types';
7
+ /**
8
+ * Curated emoji mappings for context-aware logging
9
+ * Based on the gitmoji set from https://gitmoji.dev
10
+ * Ordered by specificity - more specific keywords first
11
+ */
12
+ export declare const EMOJI_MAPPINGS: EmojiMapping[];
13
+ /**
14
+ * Default fallback emoji for each log level
15
+ * These are used when no context-specific emoji matches
16
+ */
17
+ export declare const FALLBACK_EMOJI: Record<'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'LOG', string>;
18
+ //# sourceMappingURL=emoji-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji-data.d.ts","sourceRoot":"","sources":["../../../src/formatter/emoji-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EAsFxC,CAAC;AAEF;;;GAGG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B;IACzB,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE;IACxG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;IAClG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE;IAE7J,cAAc;IACd,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE;IAE3H,wCAAwC;IACxC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE;CACnI,CAAC;AAEF;;;GAGG;AACU,QAAA,cAAc,GAAgE;IACzF,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,GAAG;IACV,GAAG,EAAE,GAAG;CACT,CAAC"}
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ /**
3
+ * Emoji selector for context-aware logging
4
+ * Analyzes log messages to select appropriate emoji based on context
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EmojiSelector = void 0;
8
+ const types_1 = require("../types/index.cjs");
9
+ const emoji_data_1 = require("./emoji-data.cjs");
10
+ /**
11
+ * Emoji selector class
12
+ * Provides context-aware emoji selection for log messages
13
+ */
14
+ class EmojiSelector {
15
+ /**
16
+ * Configure the emoji selector
17
+ * @param config - Configuration options
18
+ */
19
+ static configure(config) {
20
+ EmojiSelector.config = {
21
+ ...EmojiSelector.config,
22
+ ...config
23
+ };
24
+ // Invalidate compiled cache when config changes
25
+ EmojiSelector.compiledMappings = null;
26
+ }
27
+ /**
28
+ * Get current configuration
29
+ * @returns Current emoji configuration
30
+ */
31
+ static getConfig() {
32
+ const { customMappings = [], customFallbacks = {}, ...rest } = EmojiSelector.config;
33
+ return {
34
+ ...rest,
35
+ customMappings: [...customMappings],
36
+ customFallbacks: { ...customFallbacks }
37
+ };
38
+ }
39
+ /**
40
+ * Reset configuration to defaults
41
+ */
42
+ static reset() {
43
+ EmojiSelector.config = {
44
+ customMappings: [],
45
+ customFallbacks: {},
46
+ useCustomOnly: false
47
+ };
48
+ // Clear compiled cache
49
+ EmojiSelector.compiledMappings = null;
50
+ }
51
+ /**
52
+ * Get compiled emoji mappings with precompiled regex patterns
53
+ * This is cached to avoid recompiling regex on every log line
54
+ */
55
+ static getCompiledMappings() {
56
+ if (EmojiSelector.compiledMappings) {
57
+ return EmojiSelector.compiledMappings;
58
+ }
59
+ const { customMappings = [], useCustomOnly } = EmojiSelector.config;
60
+ const mappings = useCustomOnly ? customMappings : [...customMappings, ...emoji_data_1.EMOJI_MAPPINGS];
61
+ EmojiSelector.compiledMappings = mappings.map(mapping => ({
62
+ ...mapping,
63
+ regexes: mapping.keywords.map(keyword => {
64
+ // Escape regex metacharacters to prevent ReDoS and invalid patterns
65
+ const escapedKeyword = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
66
+ // Precompile regex for performance
67
+ // eslint-disable-next-line security/detect-non-literal-regexp -- Safe: keyword is escaped above to prevent ReDoS
68
+ return new RegExp(`\\b${escapedKeyword}\\b`, 'i');
69
+ })
70
+ }));
71
+ return EmojiSelector.compiledMappings;
72
+ }
73
+ /**
74
+ * Select appropriate emoji based on log level and message content
75
+ * @param level - Log level
76
+ * @param message - Log message
77
+ * @param data - Optional log data
78
+ * @returns Selected emoji or empty string
79
+ */
80
+ static selectEmoji(level, message, data) {
81
+ // Try to find context-aware emoji
82
+ const contextEmoji = EmojiSelector.findContextEmoji(message, data);
83
+ if (contextEmoji) {
84
+ return contextEmoji;
85
+ }
86
+ // Fall back to level-based emoji
87
+ return EmojiSelector.getFallbackEmoji(level);
88
+ }
89
+ /**
90
+ * Find emoji based on message and data context
91
+ * @param message - Log message
92
+ * @param data - Optional log data
93
+ * @returns Emoji if match found, null otherwise
94
+ */
95
+ static findContextEmoji(message, data) {
96
+ const searchText = EmojiSelector.prepareSearchText(message, data);
97
+ const compiledMappings = EmojiSelector.getCompiledMappings();
98
+ // Search through compiled mappings for keyword matches
99
+ for (const mapping of compiledMappings) {
100
+ if (EmojiSelector.matchesWithCompiledRegexes(searchText, mapping.regexes)) {
101
+ return mapping.emoji;
102
+ }
103
+ }
104
+ return null;
105
+ }
106
+ /**
107
+ * Prepare text for searching by combining message and data
108
+ * @param message - Log message
109
+ * @param data - Optional log data
110
+ * @returns Lowercase combined text
111
+ */
112
+ static prepareSearchText(message, data) {
113
+ let text = message.toLowerCase();
114
+ // If data is provided and is an object, include only keys for analysis
115
+ // Avoid expensive JSON.stringify on full object to optimize performance
116
+ if (data && typeof data === 'object') {
117
+ try {
118
+ const keys = Object.keys(data).join(' ').toLowerCase();
119
+ text += ' ' + keys;
120
+ }
121
+ catch {
122
+ // Ignore circular references or stringify errors
123
+ }
124
+ }
125
+ else if (data && typeof data === 'string') {
126
+ text += ' ' + data.toLowerCase();
127
+ }
128
+ return text;
129
+ }
130
+ /**
131
+ * Check if search text matches any of the precompiled regexes
132
+ * @param searchText - Lowercase text to search in
133
+ * @param regexes - Precompiled regex patterns
134
+ * @returns true if any regex matches
135
+ */
136
+ static matchesWithCompiledRegexes(searchText, regexes) {
137
+ return regexes.some(regex => regex.test(searchText));
138
+ }
139
+ /**
140
+ * Get fallback emoji for a given log level
141
+ * @param level - Log level
142
+ * @returns Fallback emoji for the level
143
+ */
144
+ static getFallbackEmoji(level) {
145
+ const levelName = EmojiSelector.getLevelName(level);
146
+ // Explicitly handle unknown levels: no emoji by default
147
+ if (levelName === 'UNKNOWN') {
148
+ return '';
149
+ }
150
+ const { customFallbacks = {} } = EmojiSelector.config;
151
+ // Check custom fallbacks first using safe property access
152
+ if (Object.prototype.hasOwnProperty.call(customFallbacks, levelName)) {
153
+ switch (levelName) {
154
+ case 'DEBUG':
155
+ return customFallbacks.DEBUG || '';
156
+ case 'INFO':
157
+ return customFallbacks.INFO || '';
158
+ case 'WARN':
159
+ return customFallbacks.WARN || '';
160
+ case 'ERROR':
161
+ return customFallbacks.ERROR || '';
162
+ case 'LOG':
163
+ return customFallbacks.LOG || '';
164
+ default:
165
+ // levelName is type-constrained, but default defensively returns empty
166
+ return '';
167
+ }
168
+ }
169
+ // Use default fallback with explicit switch
170
+ switch (levelName) {
171
+ case 'DEBUG':
172
+ return emoji_data_1.FALLBACK_EMOJI.DEBUG;
173
+ case 'INFO':
174
+ return emoji_data_1.FALLBACK_EMOJI.INFO;
175
+ case 'WARN':
176
+ return emoji_data_1.FALLBACK_EMOJI.WARN;
177
+ case 'ERROR':
178
+ return emoji_data_1.FALLBACK_EMOJI.ERROR;
179
+ case 'LOG':
180
+ return emoji_data_1.FALLBACK_EMOJI.LOG;
181
+ default:
182
+ return '';
183
+ }
184
+ }
185
+ /**
186
+ * Convert LogLevel enum to string
187
+ * @param level - Log level
188
+ * @returns Level name as string
189
+ */
190
+ static getLevelName(level) {
191
+ switch (level) {
192
+ case types_1.LogLevel.DEBUG: return 'DEBUG';
193
+ case types_1.LogLevel.INFO: return 'INFO';
194
+ case types_1.LogLevel.WARN: return 'WARN';
195
+ case types_1.LogLevel.ERROR: return 'ERROR';
196
+ case types_1.LogLevel.LOG: return 'LOG';
197
+ default: return 'UNKNOWN';
198
+ }
199
+ }
200
+ }
201
+ exports.EmojiSelector = EmojiSelector;
202
+ EmojiSelector.config = {
203
+ customMappings: [],
204
+ customFallbacks: {},
205
+ useCustomOnly: false
206
+ };
207
+ // Cache for precompiled regex patterns
208
+ EmojiSelector.compiledMappings = null;
209
+ //# sourceMappingURL=emoji-selector.js.map
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Emoji selector for context-aware logging
3
+ * Analyzes log messages to select appropriate emoji based on context
4
+ */
5
+ import { LogLevel, LogData, EmojiConfig } from '../types';
6
+ /**
7
+ * Emoji selector class
8
+ * Provides context-aware emoji selection for log messages
9
+ */
10
+ export declare class EmojiSelector {
11
+ private static config;
12
+ private static compiledMappings;
13
+ /**
14
+ * Configure the emoji selector
15
+ * @param config - Configuration options
16
+ */
17
+ static configure(config: Partial<EmojiConfig>): void;
18
+ /**
19
+ * Get current configuration
20
+ * @returns Current emoji configuration
21
+ */
22
+ static getConfig(): EmojiConfig;
23
+ /**
24
+ * Reset configuration to defaults
25
+ */
26
+ static reset(): void;
27
+ /**
28
+ * Get compiled emoji mappings with precompiled regex patterns
29
+ * This is cached to avoid recompiling regex on every log line
30
+ */
31
+ private static getCompiledMappings;
32
+ /**
33
+ * Select appropriate emoji based on log level and message content
34
+ * @param level - Log level
35
+ * @param message - Log message
36
+ * @param data - Optional log data
37
+ * @returns Selected emoji or empty string
38
+ */
39
+ static selectEmoji(level: LogLevel, message: string, data?: LogData): string;
40
+ /**
41
+ * Find emoji based on message and data context
42
+ * @param message - Log message
43
+ * @param data - Optional log data
44
+ * @returns Emoji if match found, null otherwise
45
+ */
46
+ private static findContextEmoji;
47
+ /**
48
+ * Prepare text for searching by combining message and data
49
+ * @param message - Log message
50
+ * @param data - Optional log data
51
+ * @returns Lowercase combined text
52
+ */
53
+ private static prepareSearchText;
54
+ /**
55
+ * Check if search text matches any of the precompiled regexes
56
+ * @param searchText - Lowercase text to search in
57
+ * @param regexes - Precompiled regex patterns
58
+ * @returns true if any regex matches
59
+ */
60
+ private static matchesWithCompiledRegexes;
61
+ /**
62
+ * Get fallback emoji for a given log level
63
+ * @param level - Log level
64
+ * @returns Fallback emoji for the level
65
+ */
66
+ private static getFallbackEmoji;
67
+ /**
68
+ * Convert LogLevel enum to string
69
+ * @param level - Log level
70
+ * @returns Level name as string
71
+ */
72
+ private static getLevelName;
73
+ }
74
+ //# sourceMappingURL=emoji-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji-selector.d.ts","sourceRoot":"","sources":["../../../src/formatter/emoji-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAc1D;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAInB;IAGF,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAuC;IAEtE;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IASpD;;;OAGG;IACH,MAAM,CAAC,SAAS,IAAI,WAAW;IAU/B;;OAEG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;IAUpB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAsBlC;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM;IAW5E;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAc/B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAmBhC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAIzC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA8C/B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAU5B"}
@@ -0,0 +1 @@
1
+ {"version":3,"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