{"id":30172969,"url":"https://github.com/ericshantos/logger.js","last_synced_at":"2025-08-11T23:20:24.565Z","repository":{"id":304388347,"uuid":"1018519051","full_name":"ericshantos/logger.js","owner":"ericshantos","description":"Modular and extensible TypeScript logger with hexagonal architecture, for flexible and easy-to-maintain Node.js applications.","archived":false,"fork":false,"pushed_at":"2025-07-12T19:33:09.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-12T20:32:02.452Z","etag":null,"topics":["logger","typescripts"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericshantos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-07-12T12:40:56.000Z","updated_at":"2025-07-12T19:33:12.000Z","dependencies_parsed_at":"2025-07-12T20:32:19.194Z","dependency_job_id":"c653e234-f2ea-4163-a223-69960dd54b9a","html_url":"https://github.com/ericshantos/logger.js","commit_stats":null,"previous_names":["ericshantos/logger.js"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ericshantos/logger.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericshantos%2Flogger.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericshantos%2Flogger.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericshantos%2Flogger.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericshantos%2Flogger.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericshantos","download_url":"https://codeload.github.com/ericshantos/logger.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericshantos%2Flogger.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269970138,"owners_count":24505478,"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-08-11T02:00:10.019Z","response_time":75,"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":["logger","typescripts"],"created_at":"2025-08-11T23:20:19.938Z","updated_at":"2025-08-11T23:20:24.554Z","avatar_url":"https://github.com/ericshantos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[🇧🇷] [Lê em português](./README.pt.md)\n\n# Logger.js\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=flat\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n\nA flexible and extensible TypeScript logger package based on the hexagonal architecture, with support for multiple output adapters, including console and files.\n\n## Features\n\n- Multiple log levels: `verbose`, `info`, `warn`, `error`\n- Configurable minimum log level\n- Simple and clean API\n- TypeScript support\n- Hexagonal architecture for easy extensibility\n\n## Installation\n\n```bash\nnpm install @ericshantos/logger\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport { Logger } from '@ericshantos/logger';\n\nconst logger = new Logger('info'); // 'info' is the default level\n\nlogger.verbose('This is a verbose message'); // Won't be logged if level is 'info'\nlogger.info('This is an info message');\nlogger.warn('This is a warning message');\nlogger.error('This is an error message');\n```\n\n### Custom Log Levels\n\nYou can set the minimum log level when creating the logger:\n\n```typescript\nconst verboseLogger = new Logger('verbose'); // Will log all levels\nconst errorOnlyLogger = new Logger('error'); // Will log only errors\n```\n\n### Extending the Logger\n\nThe package follows hexagonal architecture principles, making it easy to create custom adapters. Implement the `LoggerContract` interface to create your own logger implementations.\n\n```typescript\nimport type { LoggerContract, LogLevel } from '@ericshantos/logger';\n\nclass CustomLogger implements LoggerContract {\n    // Implement all required methods\n}\n```\n\n## API Reference\n\n### `Logger` Class\n\n#### Constructor\n```typescript\nnew Logger(level?: LogLevel = 'info')\n```\n\n#### Methods\n- `verbose(message: string): void`\n- `info(message: string): void`\n- `warn(message: string): void`\n- `error(message: string): void`\n\n### Types\n- `LogLevel`: `'verbose' | 'info' | 'warn' | 'error'`\n- `LoggerContract`: Interface that all logger implementations must follow\n\n## Development\n\n### Building the Project\n\n```bash\nnpm run build\n```\n\n### Project Structure\n\n```\n├── src\n│   ├── core\n│   │   ├── contracts        # Core interfaces and types\n│   │   └── logger.service.ts # Main logger implementation\n│   └── index.ts            # Public API exports\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericshantos%2Flogger.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericshantos%2Flogger.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericshantos%2Flogger.js/lists"}