{"_id":"@anindividual/logger","name":"@anindividual/logger","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anindividual/logger","version":"1.0.0","description":"Smart logger with file support, build process integration, and AI-friendly debugging","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && tsc","test":"jest","prepublishOnly":"npm run build"},"publishConfig":{"access":"public"},"keywords":["logger","debugging","typescript","development"],"author":{"name":"Allan"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.0","@types/node":"^18.15.11","jest":"^29.5.0","rimraf":"^4.4.1","ts-jest":"^29.1.0","typescript":"^5.0.4"},"_id":"@anindividual/logger@1.0.0","_nodeVersion":"22.11.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-/MGTg14wsPAiP/RlcfIoTboEuep5zX2MKYZcXP5Y6zm0UBn2J2fgpH+QMFNZinb8cbtYeJr+/gIzzDFAjc2BfQ==","shasum":"b54e758e2c15f4b9e39a61d39ea13c0d6f88e608","tarball":"https://registry.npmjs.org/@anindividual/logger/-/logger-1.0.0.tgz","fileCount":12,"unpackedSize":23209,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGTLGCHMRfVLl725aR11UGN2SOixRWi1Jjn9h91v0W8lAiAoastw/902gBepm3erx1ZSAcbhCcWWffThGqErU02Yrw=="}]},"_npmUser":{"name":"anindividual","email":"testvidual@gmail.com"},"directories":{},"maintainers":[{"name":"anindividual","email":"testvidual@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logger_1.0.0_1747156061087_0.7966203730232355"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-13T17:07:40.966Z","1.0.0":"2025-05-13T17:07:41.283Z","modified":"2025-05-13T17:07:41.585Z"},"maintainers":[{"name":"anindividual","email":"testvidual@gmail.com"}],"description":"Smart logger with file support, build process integration, and AI-friendly debugging","keywords":["logger","debugging","typescript","development"],"author":{"name":"Allan"},"license":"MIT","readme":"# @allan/logger\n\nA smart, production-ready logging system optimized for modern development workflows and AI-assisted debugging.\n\n## Features\n\n- **Environment-aware**: Different behavior in development and production\n- **File-based logging**: Automatic log rotation and management\n- **Build process integration**: Track build steps and errors\n- **Log analysis**: Identify error patterns and generate reports\n- **AI-friendly format**: Structured, tagged logs for better debugging with AI tools\n- **Notification system**: Alerts for critical errors\n\n## Installation\n\n```bash\nnpm install @allan/logger\n```\n\n## Basic Usage\n\n```typescript\nimport Logger from '@allan/logger';\n\n// Basic logging\nLogger.log('Application started');\nLogger.debug('INIT', 'Initializing with config:', { port: 3000 });\nLogger.warn('Connection timeout, retrying...');\nLogger.error('Failed to connect to database', err);\n\n// Critical errors (always logged, even in production)\nLogger.critical('DATABASE', 'Connection lost to primary database', error);\n```\n\n## Advanced Usage - Build Logging\n\n```typescript\nimport { BuildLogger } from '@allan/logger';\n\nasync function runBuild() {\n  const buildLogger = new BuildLogger('web-app');\n  \n  try {\n    buildLogger.log('WEBPACK', 'Starting compilation');\n    // ... build steps ...\n    buildLogger.finish(true); // Success\n    return true;\n  } catch (error) {\n    buildLogger.error('BUILD', 'Process failed', error);\n    buildLogger.finish(false); // Failed\n    return false;\n  }\n}\n```\n\n## Error Analysis\n\n```typescript\nimport { LogAnalyzer } from '@allan/logger';\n\nasync function analyzeErrors() {\n  const analyzer = new LogAnalyzer();\n  const patterns = await analyzer.findErrorPatterns(7); // Last 7 days\n  const report = await analyzer.generateErrorReport();\n  console.log(report);\n}\n```\n\n## Notification Integration\n\n```typescript\nimport { Notifier } from '@allan/logger';\n\n// Configure in your environment variables:\n// ENABLE_SLACK_NOTIFICATIONS=true\n// ENABLE_EMAIL_NOTIFICATIONS=true\n// ERROR_EMAIL_RECIPIENTS=dev@example.com,alerts@example.com\n\ntry {\n  // Critical operation\n} catch (error) {\n  await Notifier.notifyCriticalError('PAYMENT', 'Transaction failed', error);\n}\n```\n\n## AI-Assisted Debugging\n\nWhen asking AI tools like GitHub Copilot or ChatGPT to help debug, share your logs with proper tags:\n\n```\n[DEBUG] [AUTH]: Login attempt { \"username\": \"user@example.com\" }\n[ERROR] [AUTH]: Login failed Error: Invalid credentials\n```\n\nThe structured format helps AI tools better understand the context and flow of your application.\n\n## License\n\nMIT","readmeFilename":"README.md","_rev":"1-80720b56e30c58f8f60139ef6b2cbd23"}