{"_id":"@ad-execute-manager/logger","_rev":"5-0cd6e8a16b6d3df5e7ee6cc87f3620e3","name":"@ad-execute-manager/logger","dist-tags":{"latest":"2.0.5"},"versions":{"2.0.1":{"name":"@ad-execute-manager/logger","version":"2.0.1","keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"author":{"url":"https://github.com/singcl","name":"singcl","email":"iambabyer@gmail.com"},"license":"MIT","_id":"@ad-execute-manager/logger@2.0.1","maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"homepage":"https://npmjs.com/package/@ad-execute-manager/logger","bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"dist":{"shasum":"4502b94da7a2edc0e1ebb735c18b9b3f4d82e30a","tarball":"https://registry.npmjs.org/@ad-execute-manager/logger/-/logger-2.0.1.tgz","fileCount":7,"integrity":"sha512-JjDOla9ZlAOZ0lZYM72tU7pN9qK4DZaxpe9ZdjeDKKwVYsytMNUnJHpQ3ek8pHdCXu+i1mM+M6ALQklgkK3wfw==","signatures":[{"sig":"MEUCIGrbkDUUaXCv08SF819ZR+PK66Zn5PB/VdwXaW0DQefrAiEA9zt7noIhmM2RzthB5UNCzQtdv+6hlR5QV8BevYYDHgU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11635},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c21342eb4727b608dcfb81f8dcd7d90d95f5f7b3","scripts":{"dev":"rslib build --watch","lint":"eslint .","test":"rstest","build":"rslib build && tsc","format":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"singcl","email":"24661881@qq.com"},"repository":{"url":"git+https://github.com/singcl/ad-execute-manager.git","type":"git","directory":"packages/logger"},"_npmVersion":"8.5.0","description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","directories":{},"_nodeVersion":"16.14.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.2","globals":"^16.5.0","prettier":"^3.7.3","@eslint/js":"^9.39.1","typescript":"^5.9.3","@rslib/core":"^0.18.5","@rstest/core":"^0.7.2","@babel/preset-env":"^7.28.5","@babel/eslint-parser":"^7.28.5","eslint-plugin-import":"^2.32.0"},"_npmOperationalInternal":{"tmp":"tmp/logger_2.0.1_1770773926056_0.4017388251905336","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@ad-execute-manager/logger","version":"2.0.2","keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"author":{"url":"https://github.com/singcl","name":"singcl","email":"iambabyer@gmail.com"},"license":"MIT","_id":"@ad-execute-manager/logger@2.0.2","maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"homepage":"https://npmjs.com/package/@ad-execute-manager/logger","bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"dist":{"shasum":"76e0460b95413b99d9c70134f3a22faddde646c8","tarball":"https://registry.npmjs.org/@ad-execute-manager/logger/-/logger-2.0.2.tgz","fileCount":7,"integrity":"sha512-zVfDbLGd7+PyajegQ/ZiFNwDgTrQzcch8SEDqepKj7HOWkp4LAAyufISm9n+BwfkVkC/7nJ7HuN9MAhZciPJfw==","signatures":[{"sig":"MEYCIQDjW3lh8sqVpeC7+Sfzf25VRt6JhHIL1UNbifdHZV07jQIhANb4cTfqFVgFI+qrYevUBwD/KzNe0IGQhlKgRsUAGPaq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11635},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f017ee54570e6853962cd95a6e77b3b6ddc31106","scripts":{"dev":"rslib build --watch","lint":"eslint .","test":"rstest","build":"rslib build && tsc","format":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"singcl","email":"24661881@qq.com"},"repository":{"url":"git+https://github.com/singcl/ad-execute-manager.git","type":"git","directory":"packages/logger"},"_npmVersion":"8.5.0","description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","directories":{},"_nodeVersion":"16.14.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.2","globals":"^16.5.0","prettier":"^3.7.3","@eslint/js":"^9.39.1","typescript":"^5.9.3","@rslib/core":"^0.18.5","@rstest/core":"^0.7.2","@babel/preset-env":"^7.28.5","@babel/eslint-parser":"^7.28.5","eslint-plugin-import":"^2.32.0"},"_npmOperationalInternal":{"tmp":"tmp/logger_2.0.2_1770780215500_0.24347162258677857","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@ad-execute-manager/logger","version":"2.0.3","keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"author":{"url":"https://github.com/singcl","name":"singcl","email":"iambabyer@gmail.com"},"license":"MIT","_id":"@ad-execute-manager/logger@2.0.3","maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"homepage":"https://npmjs.com/package/@ad-execute-manager/logger","bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"dist":{"shasum":"5b23603455601930b5397043399ba532fac1409c","tarball":"https://registry.npmjs.org/@ad-execute-manager/logger/-/logger-2.0.3.tgz","fileCount":7,"integrity":"sha512-H6NYU6WC3gcIoy6N6c19/45kfYW6S5ZOIgQObsV+dp36StRrq8P6Qo83Jrl480te5ZEc8Bt0R+i5n7TguE6ATA==","signatures":[{"sig":"MEYCIQCSoTrHRLk6G/8EGNoVEO40/nw2wtTU/Xi/zjtSaRCkBAIhAMIhs9Tgqz4n0XVwIcGyQRhLbmsTf044+A1+cA6U+46m","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11635},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"8fed079045255dd6df26180a865e0e6eb44c506c","scripts":{"dev":"rslib build --watch","lint":"eslint .","test":"rstest","build":"rslib build && tsc","format":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"singcl","email":"24661881@qq.com"},"repository":{"url":"git+https://github.com/singcl/ad-execute-manager.git","type":"git","directory":"packages/logger"},"_npmVersion":"8.5.0","description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","directories":{},"_nodeVersion":"16.14.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.2","globals":"^16.5.0","prettier":"^3.7.3","@eslint/js":"^9.39.1","typescript":"^5.9.3","@rslib/core":"^0.18.5","@rstest/core":"^0.7.2","@babel/preset-env":"^7.28.5","@babel/eslint-parser":"^7.28.5","eslint-plugin-import":"^2.32.0"},"_npmOperationalInternal":{"tmp":"tmp/logger_2.0.3_1770797961474_0.1522227126975726","host":"s3://npm-registry-packages-npm-production"}},"2.0.4":{"name":"@ad-execute-manager/logger","version":"2.0.4","keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"author":{"url":"https://github.com/singcl","name":"singcl","email":"iambabyer@gmail.com"},"license":"MIT","_id":"@ad-execute-manager/logger@2.0.4","maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"homepage":"https://npmjs.com/package/@ad-execute-manager/logger","bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"dist":{"shasum":"e6b36edef5f1ea672f6989aae66f134f33968490","tarball":"https://registry.npmjs.org/@ad-execute-manager/logger/-/logger-2.0.4.tgz","fileCount":7,"integrity":"sha512-Pc0q+gnlGZLyr+a0RRqB7++LjRRzPuyCr6z7F9As0o/LRRy+QQQxJBA1VJgFyOjs8o2vINJmdIo4PyGdSM2YRA==","signatures":[{"sig":"MEUCIQDUUquQK8IWuOYeCZxGi/6mCQ47W1YVYxULyzm+PqXZlAIgHXKllr5Icf/OJhSOcAOGpP9VJnKoCDZIJgh97MG0CeI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11635},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"06b0851a59a8d10dd405a9b6a32103979bc97dc7","scripts":{"dev":"rslib build --watch","lint":"eslint .","test":"rstest","build":"rslib build && tsc","format":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"singcl","email":"24661881@qq.com"},"repository":{"url":"git+https://github.com/singcl/ad-execute-manager.git","type":"git","directory":"packages/logger"},"_npmVersion":"8.5.0","description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","directories":{},"_nodeVersion":"16.14.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.2","globals":"^16.5.0","prettier":"^3.7.3","@eslint/js":"^9.39.1","typescript":"^5.9.3","@rslib/core":"^0.18.5","@rstest/core":"^0.7.2","@babel/preset-env":"^7.28.5","@babel/eslint-parser":"^7.28.5","eslint-plugin-import":"^2.32.0"},"_npmOperationalInternal":{"tmp":"tmp/logger_2.0.4_1770801550522_0.23000182912644718","host":"s3://npm-registry-packages-npm-production"}},"2.0.5":{"name":"@ad-execute-manager/logger","version":"2.0.5","description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","type":"module","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"main":"./dist/index.cjs","types":"./dist/index.d.ts","author":{"name":"singcl","email":"iambabyer@gmail.com","url":"https://github.com/singcl"},"license":"MIT","homepage":"https://npmjs.com/package/@ad-execute-manager/logger","repository":{"type":"git","url":"git+https://github.com/singcl/ad-execute-manager.git","directory":"packages/logger"},"bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"engines":{"node":">=14.0.0"},"keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"scripts":{"build":"rslib build && tsc","dev":"rslib build --watch","format":"prettier --write .","lint":"eslint .","test":"rstest","prepublishOnly":"npm run build"},"devDependencies":{"@babel/eslint-parser":"^7.28.5","@babel/preset-env":"^7.28.5","@eslint/js":"^9.39.1","@rslib/core":"^0.18.5","@rstest/core":"^0.7.2","eslint":"^9.39.2","eslint-plugin-import":"^2.32.0","globals":"^16.5.0","prettier":"^3.7.3","typescript":"^5.9.3"},"gitHead":"e94775219dc85a2833c6d92aa45b41f9628fa08a","_id":"@ad-execute-manager/logger@2.0.5","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Hm8ja1q1cPrsP5/rHKqznRhRdDct3TzwS1EM6c/WhYkTH0+HfvkTK1DOZb0RfhMlqpLGAXX6RAqtxkjSYOJ0MA==","shasum":"43512fc1a1233627b379cf5a4091411c3e37ad92","tarball":"https://registry.npmjs.org/@ad-execute-manager/logger/-/logger-2.0.5.tgz","fileCount":7,"unpackedSize":11635,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF0akS2ERYxlKv0uLnMo9L+q5G6u/xboY6QcNJQEpdIgAiBJKZpcvb/j4aqdsHD1f8OEgsNEFcbqk1iZ9Exzz2H7Rg=="}]},"_npmUser":{"name":"singcl","email":"24661881@qq.com"},"directories":{},"maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logger_2.0.5_1770802345176_0.29369493806917557"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T01:38:45.970Z","modified":"2026-02-11T09:32:25.475Z","2.0.1":"2026-02-11T01:38:46.209Z","2.0.2":"2026-02-11T03:23:35.640Z","2.0.3":"2026-02-11T08:19:21.615Z","2.0.4":"2026-02-11T09:19:10.677Z","2.0.5":"2026-02-11T09:32:25.338Z"},"bugs":{"url":"https://github.com/singcl/ad-execute-manager/issues"},"author":{"name":"singcl","email":"iambabyer@gmail.com","url":"https://github.com/singcl"},"license":"MIT","homepage":"https://npmjs.com/package/@ad-execute-manager/logger","keywords":["logger","logging","utility","javascript","nodejs","typescript","log-levels","debug"],"repository":{"type":"git","url":"git+https://github.com/singcl/ad-execute-manager.git","directory":"packages/logger"},"description":"A flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.","maintainers":[{"name":"singcl","email":"24661881@qq.com"}],"readme":"# @ad-execute-manager/logger\n\nA flexible logging utility for JavaScript applications with multiple log levels and customizable prefixes.\n\n## Installation\n\n```bash\nnpm install @ad-execute-manager/logger\n```\n\n## Features\n\n- **Multiple Log Levels**: Support for error, warn, info, log, and debug levels\n- **Customizable Prefix**: Add a prefix to identify the source of logs\n- **Log Level Control**: Set minimum log level to filter out less important messages\n- **Enable/Disable**: Toggle logging on and off as needed\n- **TypeScript Support**: Includes TypeScript type definitions\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport { Logger } from '@ad-execute-manager/logger';\n\n// Create a logger instance\nconst logger = new Logger({\n  prefix: 'MyApp',\n  level: 'info',\n  enabled: true\n});\n\n// Log messages at different levels\nlogger.error('Something went wrong');\nlogger.warn('This is a warning');\nlogger.info('Application started');\nlogger.log('Regular message');\nlogger.debug('Debug information');\n```\n\n### Log Level Control\n\n```javascript\nimport { Logger } from '@ad-execute-manager/logger';\n\n// Create logger with different levels\nconst productionLogger = new Logger({\n  prefix: 'App',\n  level: 'warn' // Only show warn and error messages\n});\n\nconst developmentLogger = new Logger({\n  prefix: 'App',\n  level: 'debug' // Show all messages\n});\n\n// Change level dynamically\nproductionLogger.setLevel('info');\n```\n\n### Enable/Disable Logging\n\n```javascript\nimport { Logger } from '@ad-execute-manager/logger';\n\nconst logger = new Logger({ prefix: 'MyApp' });\n\n// Disable logging\nlogger.disable();\nlogger.info('This won\\'t be logged');\n\n// Enable logging\nlogger.enable();\nlogger.info('This will be logged');\n\n// Check if logging is enabled\nif (logger.isEnabled()) {\n  logger.log('Logging is enabled');\n}\n```\n\n### Real-world Examples\n\n#### 1. Application Logging\n\n```javascript\nimport { Logger } from '@ad-execute-manager/logger';\n\n// Create logger based on environment\nconst logger = new Logger({\n  prefix: 'MyApp',\n  level: process.env.NODE_ENV === 'production' ? 'info' : 'debug'\n});\n\n// Log application startup\nlogger.info('Application started');\n\n// Log errors\nfunction handleError(error) {\n  logger.error('Error occurred:', error);\n  // Error handling logic\n}\n\n// Log debug information\nfunction processData(data) {\n  logger.debug('Processing data:', data);\n  // Processing logic\n  logger.info('Data processed successfully');\n}\n```\n\n#### 2. Module-specific Logging\n\n```javascript\nimport { Logger } from '@ad-execute-manager/logger';\n\n// Create logger for different modules\nconst authLogger = new Logger({ prefix: 'AuthModule' });\nconst apiLogger = new Logger({ prefix: 'APIModule' });\nconst dbLogger = new Logger({ prefix: 'DBModule' });\n\n// Use in different modules\nfunction login(user) {\n  authLogger.info('User login attempt:', user.username);\n  // Login logic\n}\n\nfunction fetchData() {\n  apiLogger.debug('Fetching data from API');\n  // API call\n  apiLogger.info('Data fetched successfully');\n}\n\nfunction saveData(data) {\n  dbLogger.debug('Saving data to database');\n  // Database operation\n  dbLogger.info('Data saved successfully');\n}\n```\n\n## API\n\n### Constructor\n\n```javascript\nnew Logger(options)\n```\n\n- **options** (Object): Configuration options\n  - **prefix** (String): Log prefix, defaults to 'Logger'\n  - **level** (String): Log level, options: 'error', 'warn', 'info', 'log', 'debug', defaults to 'log'\n  - **enabled** (Boolean): Whether logging is enabled, defaults to true\n\n### Methods\n\n- **enable()**: Enable logging\n- **disable()**: Disable logging\n- **isEnabled()**: Return whether logging is enabled\n- **setLevel(level)**: Set log level\n  - **level** (String): Log level\n- **error(message, ...args)**: Output error log\n- **warn(message, ...args)**: Output warning log\n- **info(message, ...args)**: Output info log\n- **log(message, ...args)**: Output regular log\n- **debug(message, ...args)**: Output debug log\n\n### Log Levels\n\n| Level   | Description                  | Methods            |\n|---------|------------------------------|--------------------|\n| error   | Error messages               | logger.error()     |\n| warn    | Warning messages             | logger.warn()      |\n| info    | Information messages         | logger.info()      |\n| log     | Regular messages             | logger.log()       |\n| debug   | Debug information            | logger.debug()     |\n\nThe log level is hierarchical, meaning if you set the level to 'info', it will show info, warn, and error messages, but not log or debug messages.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}