{"id":24894850,"url":"https://github.com/ayocord-js/ayologger","last_synced_at":"2026-05-18T15:03:54.427Z","repository":{"id":267151817,"uuid":"900371903","full_name":"ayocord-js/ayologger","owner":"ayocord-js","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-25T19:59:17.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:23:26.131Z","etag":null,"topics":["console","js","library","logger","ts","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","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/ayocord-js.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}},"created_at":"2024-12-08T15:59:12.000Z","updated_at":"2024-12-29T19:06:56.000Z","dependencies_parsed_at":"2024-12-08T18:22:26.340Z","dependency_job_id":"6622302c-3b01-4fed-ba4d-dfb8a4d2de02","html_url":"https://github.com/ayocord-js/ayologger","commit_stats":null,"previous_names":["ayomits/ayologger","ayocord-js/ayologger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayocord-js/ayologger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayocord-js%2Fayologger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayocord-js%2Fayologger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayocord-js%2Fayologger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayocord-js%2Fayologger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayocord-js","download_url":"https://codeload.github.com/ayocord-js/ayologger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayocord-js%2Fayologger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271420155,"owners_count":24756491,"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-21T02:00:08.990Z","response_time":74,"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":["console","js","library","logger","ts","typescript","typescript-library"],"created_at":"2025-02-01T19:14:54.206Z","updated_at":"2026-05-18T15:03:49.403Z","avatar_url":"https://github.com/ayocord-js.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ayologger\n\nA customizable, extensible, and lightweight logging library for Node.js.\n\n## Features\n\n- **Customizable Themes**: Define colors for log levels, dates, and messages.\n- **Template-Based Output**: Use templates to format logs.\n- **Date Formatting**: Set custom date formats.\n- **Log Levels**: Includes `info`, `warn`, `error`, `success`, and `debug`.\n- **Base Color Support**: Apply a consistent base color to all non-template text.\n- **Custom Log Level Names**: Personalize log level names for better readability.\n- **Flexible Formatting**: Set custom date format and base color for logs.\n\n\u003e This module requires ES6 Syntax in your project\n\u003e In package.json set \"type\": \"module\"\n\n## Installation\n\nTo install the `ayologger` package, use either npm or yarn:\n\n```bash\nnpm install ayologger\n```\n\n```bash\nyarn add ayologger\n```\n\n## Usage\n\n### Basic Usage\n\nTo use the logger, you can import it into your project and use different log levels:\n\n```typescript\nimport { Logger } from \"ayologger\";\n\nconst logger = new Logger();\n\nlogger.info(\"Hello, World!\");\nlogger.warn(\"This is a warning.\");\nlogger.error(\"An error occurred.\");\nlogger.success(\"Operation successful!\");\nlogger.debug(\"Debugging information.\");\n```\n\nEach method corresponds to a specific log level (`info`, `warn`, `error`, `success`, `debug`). Logs are printed in the console with appropriate color formatting for each level.\n\n## Themes\n\n### Custom Themes\n\nYou can customize the appearance of each log level (e.g., changing colors for the log level, message, or date). Below is a detailed example of how to apply a custom theme to different log levels.\n\n```typescript\nconst logger = new Logger({\n    global: {\n        // Global settings for log level and message formatting\n        level: { text: \"#ffffff\", background: \"#0000ff\" },  // White text on blue background for the log level\n        date: { text: \"#ff0000\" },  // Red text for the date\n    },\n    theme: {\n        // Custom theme for each log level\n        info: {\n            level: { background: \"#00ff00\" },  // Green background for info level\n            message: { text: \"#ffffff\" },  // White text for the message\n            date: { text: \"#00ff00\" },  // Green text for the date\n        },\n        warn: {\n            level: { background: \"#ffff00\" },  // Yellow background for warn level\n            message: { text: \"#000000\" },  // Black text for the message\n            date: { text: \"#ff9900\" },  // Orange text for the date\n        },\n        error: {\n            level: { text: \"#ff0000\", background: \"#000000\" },  // Red text on black background for error level\n            message: { text: \"#ffffff\" },  // White text for the message\n            date: { text: \"#ff3300\" },  // Light red text for the date\n        },\n        success: {\n            level: { background: \"#00cc00\" },  // Green background for success level\n            message: { text: \"#ffffff\" },  // White text for the message\n            date: { text: \"#009900\" },  // Dark green text for the date\n        },\n        debug: {\n            level: { background: \"#800080\" },  // Purple background for debug level\n            message: { text: \"#ffffff\" },  // White text for the message\n            date: { text: \"#ff00ff\" },  // Magenta text for the date\n        },\n    },\n    formatting: {\n        // Custom date format and base color for all logs\n        dateFormat: \"YYYY-MM-DD HH:mm:ss\",  // Custom date format (year-month-day hour:minute:second)\n        baseColor: \"#cccccc\",  // Base color for all logs (light gray)\n    },\n});\n\n// Test logs with the custom theme\nlogger.info(\"Custom theme applied!\");\nlogger.warn(\"Warning with custom theme.\");\nlogger.error(\"Error with custom theme.\");\nlogger.success(\"Success with custom theme!\");\nlogger.debug(\"Debugging with custom theme.\");\n```\n\n### Custom Log Level Names\n\nYou can also change the names of the log levels, providing more descriptive names for logs. For example, you could rename `info` to `notice`, `warn` to `alert`, etc.\n\n```typescript\nconst logger = new Logger({\n    logNames: {\n        info: \"notice\",  // Rename info to notice\n        warn: \"alert\",   // Rename warn to alert\n        error: \"failure\",  // Rename error to failure\n        success: \"achievement\",  // Rename success to achievement\n        debug: \"trace\",   // Rename debug to trace\n    },\n});\n\nlogger.info(\"This is a notice level log.\");\nlogger.warn(\"This is an alert level log.\");\nlogger.error(\"This is a failure level log.\");\nlogger.success(\"This is an achievement level log.\");\nlogger.debug(\"This is a trace level log.\");\n```\n\n### Full Configuration Example\n\nHere is an example of a complete configuration for the `Logger` class, with a custom theme, custom date format, base color, and custom log level names:\n\n```typescript\nconst logger = new Logger({\n    global: {\n        level: { text: \"#ffffff\", background: \"#0000ff\" },\n        date: { text: \"#ff0000\" },\n    },\n    theme: {\n        info: {\n            level: { background: \"#00ff00\" },\n            message: { text: \"#ffffff\" },\n            date: { text: \"#00ff00\" },\n        },\n        warn: {\n            level: { background: \"#ffff00\" },\n            message: { text: \"#000000\" },\n            date: { text: \"#ff9900\" },\n        },\n        error: {\n            level: { text: \"#ff0000\", background: \"#000000\" },\n            message: { text: \"#ffffff\" },\n            date: { text: \"#ff3300\" },\n        },\n        success: {\n            level: { background: \"#00cc00\" },\n            message: { text: \"#ffffff\" },\n            date: { text: \"#009900\" },\n        },\n        debug: {\n            level: { background: \"#800080\" },\n            message: { text: \"#ffffff\" },\n            date: { text: \"#ff00ff\" },\n        },\n    },\n    formatting: {\n        dateFormat: \"YYYY-MM-DD HH:mm:ss\",\n        baseColor: \"#cccccc\",\n    },\n    logNames: {\n        info: \"notice\",\n        warn: \"alert\",\n        error: \"failure\",\n        success: \"achievement\",\n        debug: \"trace\",\n    },\n});\n\nlogger.info(\"Custom notice log.\");\nlogger.warn(\"Custom alert log.\");\nlogger.error(\"Custom failure log.\");\nlogger.success(\"Custom achievement log.\");\nlogger.debug(\"Custom trace log.\");\n```\n\n## Custom Templates\nVariables:\n`level` - using for display log level\n`date` - using for display when this log was printed\n`message` - using for display content from function parametr\n\nExample:\n```ts\nconst logger = new Logger({\n    templates: {\n        info: () =\u003e `{date} {level} with {message}`\n    }\n})\nlogger.info(\"Hello my custom template!\")\n```\n\n## Conclusion\n\n`ayologger` provides a powerful and flexible logging system for Node.js. With customizable themes, templates, and formatting, you can make your log output as unique as your application. Whether you need simple log messages or complex structured output, `ayologger` can be tailored to meet your needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayocord-js%2Fayologger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayocord-js%2Fayologger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayocord-js%2Fayologger/lists"}