{"id":38205947,"url":"https://github.com/thisguymartin/barebone-logger","last_synced_at":"2026-01-17T00:34:53.198Z","repository":{"id":214403962,"uuid":"736439040","full_name":"thisguymartin/barebone-logger","owner":"thisguymartin","description":"Simple Node Logger is a user-friendly logging utility for Node.js, offering multiple levels like debug, info, and error. It enhances log details by allowing custom fields, making it ideal for efficient application monitoring.","archived":false,"fork":false,"pushed_at":"2024-04-25T00:10:59.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-25T01:59:29.074Z","etag":null,"topics":["lightweight","logging","nodejs","simple","vite"],"latest_commit_sha":null,"homepage":"https://thisguymartin.github.io/barebone-logger/","language":"HTML","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/thisguymartin.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}},"created_at":"2023-12-27T23:06:18.000Z","updated_at":"2024-04-25T00:11:03.000Z","dependencies_parsed_at":"2023-12-28T00:57:53.544Z","dependency_job_id":"0a6326c4-fad8-47c5-893c-3804ca0db823","html_url":"https://github.com/thisguymartin/barebone-logger","commit_stats":null,"previous_names":["thisguymartin/justlog","thisguymartin/nodesimplelogger"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/thisguymartin/barebone-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisguymartin%2Fbarebone-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisguymartin%2Fbarebone-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisguymartin%2Fbarebone-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisguymartin%2Fbarebone-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thisguymartin","download_url":"https://codeload.github.com/thisguymartin/barebone-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisguymartin%2Fbarebone-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T23:55:29.509Z","status":"ssl_error","status_checked_at":"2026-01-16T23:55:29.108Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["lightweight","logging","nodejs","simple","vite"],"created_at":"2026-01-17T00:34:52.603Z","updated_at":"2026-01-17T00:34:53.192Z","avatar_url":"https://github.com/thisguymartin.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🪵 barebone-logger\n\n\nSimple Node Logger is a lightweight and easy-to-use logging utility for Node.js applications. It provides a straightforward way to log messages at various levels (debug, info, warn, error, fatal) and supports adding custom fields to logs for more detailed information.\n\n## Features\n\n- Simple and intuitive API.\n- Supports multiple log levels: debug, info, warn, error, fatal.\n- Ability to add custom fields to logs.\n- Toggleable debug mode for development environments.\n\n## Installation\n\nTo install Simple Node Logger, use npm:\n\n```bash\nnpm install simple-node-logger\n```\n\nOr using yarn:\n\n```bash\nyarn add simple-node-logger\n```\n\n## Usage\n\n### Basic Logging\n\n\nHere's a quick example to get you started:\n\n```javascript\nconst Logger = require('simple-node-logger');\n\n// Create a new logger instance\nconst logger = new Logger();\n\n// Logging messages at different levels\nlogger.debug('This is a debug message');\nlogger.info('This is an info message');\nlogger.warn('This is a warning message');\nlogger.error('This is an error message');\nlogger.fatal('This is a fatal message');\n\n```\n\n### Advanced Logging with Custom Fields\nTo add more context to your logs, you can use withField and withFields methods:\n\n\n\n```javascript\n// Adding a single custom field\nconst logWithUser = logger.withField('userId', '12345');\nlogWithUser.info('User login event');\n\n// Adding multiple custom fields\nconst response = { status: 404, body: 'Not Found' };\nlogger.withFields({ response }).error('Response code from OEPricingMultipleV3 API was not 200');\n\n// Chaining fields for more detailed logs\nlogger\n  .withField('userId', '12345')\n  .withField('transactionId', 'abcde12345')\n  .info('Transaction completed');\n```\n\n## API Reference\n\n### `logger.debug(message)`\nLogs a debug message.\n\n### `logger.info(message)`\nLogs an informational message.\n\n### `logger.warn(message)`\nLogs a warning message.\n\n### `logger.error(message)`\nLogs an error message.\n\n### `logger.fatal(message)`\nLogs a fatal error message.\n\n### `logger.withField(key, value)`\nCreates a new logger entry with a field.\n\n### `logger.withFields(fields)`\nCreates a new logger entry with multiple fields.\n\n### `logger.setDebug(enabled)`\nEnables or disables debug mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisguymartin%2Fbarebone-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisguymartin%2Fbarebone-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisguymartin%2Fbarebone-logger/lists"}