{"id":31262754,"url":"https://github.com/mks2508/advanced-logger","last_synced_at":"2025-12-28T07:33:57.735Z","repository":{"id":312285087,"uuid":"1046958035","full_name":"MKS2508/advanced-logger","owner":"MKS2508","description":"Libreria de logging de uso compartido entre proyectos personales, 100% ts support, custom styling, exportts","archived":false,"fork":false,"pushed_at":"2025-09-02T21:57:50.000Z","size":782,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-08T14:46:47.289Z","etag":null,"topics":["logging","npm","typescript-library"],"latest_commit_sha":null,"homepage":"https://mks2508.github.io/advanced-logger/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MKS2508.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-29T14:00:14.000Z","updated_at":"2025-09-02T21:56:23.000Z","dependencies_parsed_at":"2025-08-29T17:16:16.054Z","dependency_job_id":"99c4c6f1-7182-4066-a7ad-7ea949424114","html_url":"https://github.com/MKS2508/advanced-logger","commit_stats":null,"previous_names":["mks2508/advanced-logger"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/MKS2508/advanced-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKS2508%2Fadvanced-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKS2508%2Fadvanced-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKS2508%2Fadvanced-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKS2508%2Fadvanced-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MKS2508","download_url":"https://codeload.github.com/MKS2508/advanced-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKS2508%2Fadvanced-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276570675,"owners_count":25665900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","npm","typescript-library"],"created_at":"2025-09-23T11:53:56.629Z","updated_at":"2025-12-28T07:33:57.727Z","avatar_url":"https://github.com/MKS2508.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Better Logger\n\n**Enterprise-grade console logger with custom serializers, hooks, transports, and beautiful styling**\n\n[![NPM Version](https://img.shields.io/npm/v/@mks2508/better-logger)](https://www.npmjs.com/package/@mks2508/better-logger)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@mks2508/better-logger)](https://bundlephobia.com/package/@mks2508/better-logger)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)\n[![License](https://img.shields.io/npm/l/@mks2508/better-logger)](https://github.com/MKS2508/advanced-logger/blob/main/LICENSE)\n\nTransform your console logging experience with enterprise features like Pino/Winston: custom serializers, hooks/middleware, and transports - all with beautiful styling and professional themes.\n\n## ✨ Features\n\n### Core Features\n- 🚀 **Simplified API** - 80% less code for basic use cases\n- 🎨 **Smart Presets** - Apply beautiful themes in one line: `logger.preset('cyberpunk')`\n- 🏷️ **Badges System** - Flexible tagging with `badges()` and `badge()`\n- 🌗 **Adaptive Themes** - Automatic light/dark mode detection\n- 🎯 **TypeScript First** - Complete type safety and IntelliSense\n\n### Enterprise Features (v3.0.0)\n- 🔄 **Custom Serializers** - Transform any object type for logging\n- 🪝 **Hooks \u0026 Middleware** - Intercept and modify logs with `on()`, `use()`\n- 📡 **Transports** - File, HTTP, and custom transport destinations\n- ⚡ **High Performance** - ~50-100x less memory with delegation pattern\n- 💾 **Style Cache** - LRU cache for computed styles\n\n## 📦 Installation\n\n### Full Package (Recommended)\n```bash\nnpm install @mks2508/better-logger\n```\n\n### Modular Installation  \nChoose only the functionality you need:\n\n```bash\n# Core logging only (~15KB)\nnpm install @mks2508/better-logger-core\n\n# Add styling capabilities (~12KB)  \nnpm install @mks2508/better-logger-styling\n\n# Add export handlers (~18KB)\nnpm install @mks2508/better-logger-exports\n```\n\n\u003e 📋 **[View Complete Packages Guide →](https://mks2508.github.io/advanced-logger/packages/)**\n\n## 🚀 Quick Start\n\n### Basic Usage (Zero Configuration)\n```javascript\nimport logger from '@mks2508/better-logger';\n\n// Works perfectly out-of-the-box with adaptive themes\nlogger.info('Application started');\nlogger.success('Database connected');\nlogger.warn('High memory usage');\nlogger.error('Connection failed');\n```\n\n### One-Line Styling\n```javascript\n// Apply beautiful presets instantly\nlogger.preset('cyberpunk');     // Neon colors, glowing effects\nlogger.preset('glassmorphism'); // Modern blur effects\nlogger.preset('minimal');       // Clean and simple\nlogger.preset('debug');         // Detailed development mode\n```\n\n### Toggle Features\n```javascript\n// Control visibility with simple methods\nlogger.hideTimestamp();\nlogger.showLocation();\nlogger.hideBadges();\n```\n\n### Component \u0026 API Logging\n```javascript\n// Scoped loggers with auto-badges (sync, lightweight)\nconst auth = logger.component('UserAuth');\nauth.info('Login attempt');     // [COMPONENT] [UserAuth] Login attempt\nauth.success('User verified');  // [COMPONENT] [UserAuth] User verified\n\n// API loggers with multiple badges\nconst api = logger.api('GraphQL');\napi.badges(['SLOW', 'CACHE']).warn('Query timeout');\n```\n\n## 🔄 Enterprise Features (v3.0.0)\n\n### Custom Serializers\nTransform complex objects before logging:\n\n```typescript\n// Register serializers for custom types\nlogger.addSerializer(Error, (err) =\u003e ({\n  name: err.name,\n  message: err.message,\n  stack: err.stack?.split('\\n').slice(0, 5)\n}));\n\nlogger.addSerializer(User, (user) =\u003e ({\n  id: user.id,\n  email: user.email  // password automatically omitted\n}));\n\n// Now errors and users are serialized automatically\nlogger.error('Failed:', new Error('Connection timeout'));\nlogger.info('User login:', currentUser);\n```\n\n### Hooks \u0026 Middleware\nIntercept and modify logs:\n\n```typescript\n// Add correlation ID to all logs\nlogger.on('beforeLog', (entry) =\u003e {\n  entry.correlationId = getCorrelationId();\n  return entry;\n});\n\n// Track metrics after logging\nlogger.on('afterLog', (entry) =\u003e {\n  metrics.increment(`logs.${entry.level}`);\n});\n\n// Middleware pipeline\nlogger.use((entry, next) =\u003e {\n  entry.requestId = asyncLocalStorage.getStore()?.requestId;\n  next();\n});\n\n// Redact sensitive data\nlogger.use((entry, next) =\u003e {\n  entry.message = entry.message.replace(/password=\\S+/g, 'password=***');\n  next();\n});\n```\n\n### Transports\nSend logs to multiple destinations:\n\n```typescript\n// File transport (Node.js)\nlogger.addTransport({\n  target: 'file',\n  options: { destination: '/var/log/app.log' }\n});\n\n// HTTP transport with batching\nlogger.addTransport({\n  target: 'http',\n  options: {\n    url: 'https://logs.example.com/ingest',\n    batchSize: 100,\n    flushInterval: 5000\n  },\n  level: 'warn'  // Only warn and above\n});\n\n// Custom transport\nlogger.addTransport({\n  target: {\n    name: 'elasticsearch',\n    write: async (record) =\u003e {\n      await esClient.index({ index: 'logs', body: record });\n    }\n  }\n});\n\n// Flush and close when shutting down\nawait logger.flushTransports();\nawait logger.closeTransports();\n```\n\n### Badges System\nFlexible tagging for logs:\n\n```typescript\n// Multiple badges\nlogger.badges(['v3', 'stable']).info('Release published');\n\n// Chain badges\nlogger.badge('DEBUG').badge('AUTH').info('Token validated');\n\n// Clear badges\nlogger.clearBadges().info('Clean log');\n```\n\n### Simple Customization\n```javascript\n// Minimal configuration for specific needs\nlogger.customize({\n  message: { color: '#007bff', size: '15px' },\n  timestamp: { show: false },\n  spacing: 'compact'\n});\n```\n\n### Advanced Styling (Power Users)\n```typescript\nimport { Logger } from '@mks2508/better-logger';\n\nconst logger = new Logger({ prefix: 'APP' });\n\n// Beautiful styled logging\nlogger.info('Application started', { version: '1.0.0' });\nlogger.success('Database connected successfully');\nlogger.warn('Memory usage high', { usage: '85%' });\nlogger.error('API request failed', { status: 500 });\n\n// Performance timing\nlogger.time('operation');\nawait performOperation();\nlogger.timeEnd('operation'); // Shows duration with beautiful styling\n```\n\n## 🔧 Enhanced CLI Interface\n\nNew in v0.1.0-rc.1! Interactive CLI with plugin support and command history:\n\n```typescript\nimport { Logger } from '@mks2508/better-logger';\n\nconst logger = new Logger();\n\n// Enter interactive mode\nlogger.executeCommand('/interactive');\n\n// Use enhanced CLI in browser console:\ncli('help');             // Show all commands\ncli('theme cyberpunk');  // Change theme\ncli('history 5');        // View command history  \ncli('plugins');          // List loaded plugins\n\n// Create custom plugins\nconst myPlugin = {\n  name: 'analytics',\n  commands: [{ \n    name: 'track', \n    execute: (args, logger) =\u003e logger.info(`Tracking: ${args}`) \n  }]\n};\nlogger.cliProcessor.registerPlugin(myPlugin);\n```\n\n## 🔧 Modular Usage\n\nImport only what you need for optimal bundle sizes:\n\n```typescript\n// Core logging only (6KB) - Essential features\nimport { Logger } from '@mks2508/better-logger/core';\n\n// Styling features (26KB) - Themes, SVG, animations\nimport { setTheme, logAnimated } from '@mks2508/better-logger/styling';\n\n// Export capabilities (12KB) - Data export, remote logging\nimport { ExportLogger } from '@mks2508/better-logger/exports';\n```\n\n## 📊 Bundle Analysis\n\n| Module | Size | Gzipped | Best For |\n|--------|------|---------|----------|\n| **Core** | 6KB | 2KB | Essential logging, Node.js apps |\n| **Styling** | 26KB | 5KB | Frontend apps, visual debugging |\n| **Exports** | 12KB | 3KB | Production logging, analytics |\n| **Full** | 64KB | 13KB | Complete feature set |\n\n## 📚 Documentation \u0026 Learning\n\n### 📖 Complete Documentation\n- **[📋 API Reference](docs/API.md)** - Complete method documentation\n- **[🚀 Core Module](docs/CORE.md)** - Essential logging features\n- **[🎨 Styling Module](docs/STYLING.md)** - Themes and visual customization  \n- **[📤 Exports Module](docs/EXPORTS.md)** - Data export and remote logging\n\n### 🎮 Interactive Learning\n- **[🌟 Live Demo](https://mks2508.github.io/advanced-logger/)** - Try all features in your browser\n- **[📁 Examples](examples/)** - 4 comprehensive tutorials with runnable code\n\n### 🏃 Quick Examples\n```bash\ncd examples \u0026\u0026 npm install\nnpm run basic        # Learn fundamentals\nnpm run performance  # Master timing operations\nnpm run styling      # Explore visual features\nnpm run export       # Data management\n```\n\n## 🎨 Visual Showcase\n\n### Professional Themes\n```typescript\nimport { setTheme } from '@mks2508/better-logger/styling';\n\nsetTheme('cyberpunk');  // Purple/pink futuristic\nsetTheme('neon');       // Bright electric colors\nsetTheme('dark');       // Dark mode optimized\n```\n\n### Custom Styling\n```typescript\nimport { createStyle } from '@mks2508/better-logger/styling';\n\nconst customStyle = createStyle()\n  .bg('linear-gradient(45deg, #667eea, #764ba2)')\n  .color('white')\n  .padding('12px 24px')\n  .rounded('8px')\n  .shadow('0 4px 15px rgba(102, 126, 234, 0.4)')\n  .build();\n\nconsole.log('%c🚀 Beautiful Custom Style!', customStyle);\n```\n\n## ⚡ Advanced Features\n\n### CLI Interface\n```typescript\nimport { initializeCLI } from '@mks2508/better-logger/cli';\ninitializeCLI(logger);\n\n// Available in browser console:\n// /help /theme /export /clear /status\n```\n\n### Performance Monitoring\n```typescript\nlogger.time('api-request');\nconst result = await fetch('/api/data');\nlogger.timeEnd('api-request'); // Automatic duration display\n```\n\n### Data Export\n```typescript\nimport { ExportLogger } from '@mks2508/better-logger/exports';\n\nconst logger = new ExportLogger();\nconst csvData = await logger.exportLogs('csv', {\n  filter: { level: 'error' },\n  limit: 100\n});\n```\n\n## 🌐 Compatibility\n\n- ✅ **All Modern Browsers** - Full feature support\n- ✅ **Node.js** - Core features with graceful fallbacks  \n- ✅ **TypeScript** - Complete type definitions\n- ✅ **ESM \u0026 CommonJS** - Both module systems supported\n\n## 🔗 Resources\n\n- 📦 **[NPM Package](https://www.npmjs.com/package/@mks2508/better-logger)**\n- 🎮 **[Interactive Demo](https://mks2508.github.io/advanced-logger/)**\n- 📚 **[Documentation](docs/)**\n- 🧩 **[Examples](examples/)**\n- 🐛 **[Issues \u0026 Support](https://github.com/MKS2508/advanced-logger/issues)**\n\n## 🤝 Contributing\n\nContributions welcome! See our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n**Made with ❤️ by [MKS2508](https://github.com/MKS2508)**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmks2508%2Fadvanced-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmks2508%2Fadvanced-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmks2508%2Fadvanced-logger/lists"}