{"id":29143594,"url":"https://github.com/confect1ondev/confectionery","last_synced_at":"2025-06-30T20:08:21.177Z","repository":{"id":104795023,"uuid":"527780790","full_name":"confect1ondev/confectionery","owner":"confect1ondev","description":"Creating logs so good, they're like candy!","archived":false,"fork":false,"pushed_at":"2022-11-02T18:33:19.000Z","size":365,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T05:52:17.782Z","etag":null,"topics":["debug","javascript","logger","logging","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/confectionery","language":"JavaScript","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/confect1ondev.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}},"created_at":"2022-08-23T00:49:13.000Z","updated_at":"2025-01-06T02:05:17.000Z","dependencies_parsed_at":"2023-09-06T18:51:14.882Z","dependency_job_id":null,"html_url":"https://github.com/confect1ondev/confectionery","commit_stats":null,"previous_names":["confect1ondev/confectionery","enbytedev/confectionery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/confect1ondev/confectionery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confect1ondev%2Fconfectionery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confect1ondev%2Fconfectionery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confect1ondev%2Fconfectionery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confect1ondev%2Fconfectionery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/confect1ondev","download_url":"https://codeload.github.com/confect1ondev/confectionery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confect1ondev%2Fconfectionery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262842911,"owners_count":23373167,"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","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":["debug","javascript","logger","logging","utility"],"created_at":"2025-06-30T20:08:19.447Z","updated_at":"2025-06-30T20:08:21.076Z","avatar_url":"https://github.com/confect1ondev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca\u003e\u003cimg src=\"https://github.com/enbytedev/confectionery/blob/main/ICON.png\" width=\"250\" height=\"250\" /\u003e\u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003e✨ confectionery ✨\u003c/h3\u003e\n \u003cp align=\"center\"\u003e\u003ci\u003ecreating easy, practical logging with instant implementation. this is the icing to your metaphorical cake!\u003c/i\u003e\u003c/p\u003e\n\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/enbytedev/confectionery\"\u003e\n      \u003cimg alt=\"GitHub Repo Stars\" src=\"https://img.shields.io/github/stars/enbytedev/confectionery?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/enbytedev/confectionery/blob/main/LICENSE\"\u003e\n      \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/enbytedev/confectionery?style=for-the-badge\u0026color=AA4A44\" /\u003e\n    \u003c/a\u003e\n  \u003chr\u003e\n\u003c/p\u003e\n\n```\nnpm i confectionery\n```\n\n### Logger\nFor example, `const logger = confectionery.createLogger(\"Logger\");` allows the following:\n```js\nlogger.log(\"This is output as INFO\");\nlogger.info(\"This is output as INFO\", \"Optional Context\");\nlogger.warn(\"This is output as WARN\");\nlogger.error(\"This is output as ERROR\", \"Optional Context\");\nlogger.debug(\"This is output as DEBUG\");\n```\n**You can have multiple logger instances at a time.**\n\n----\n### Log Levels\nA log level allows you to specify what gets printed to the console and logfiles.\n\nIn the below example, the console is set to debug and the logfile is set to error.\n`logger.setLevel(\"debug\", \"error\");`\nIn the below example, the both the console and the logfile are set to info.\n`logger.setLevel(3, 3);`\n\nThe following are provided log levels:\n|Level|#|Default|\n|--|--|--|\n|SILENT|0|\n|ERROR|1|\n|WARN|2|\n|INFO|3|X\n|DEBUG|4|\n\n----\n### Log Files\nconfectionery allows you to save logs to files. By default, this is disabled. To enable it, provide a directory to save logfiles in.\nFor example, `logger.setLogPath('./logs/');`\n\n----\n### Console Formats\nDevelopers may provide a preferred format to use when logging in the console.\nFor example, `logger.setFormat('classic');`.\nDefault templates (classic, short, symbols) can be found in `scripts/stdout/templates.js`\n\nCustom formats are also supported. Simply use `logger.setFormat();` with an object. \nThis object must contain functions that return debug, info, warn, and error. \nEach message line is printed in `${line}` and context in `${context}`. \nMoment can be used to format a timestamp. For example,\n```js\nconst customClassic = {\n    debug: function handle(moment, context, line) { return `{dim [${moment().format('HH:mm:ss:ms')}]} {bold {white DEBUG}}: {gray ${context}}${line}\\n`},\n    info: function handle(moment, context, line) { return `{dim [${moment().format('HH:mm:ss:ms')}]} {bold {cyan INFO}}:  {gray ${context}}${line}\\n`},\n    warn: function handle(moment, context, line) { return `{dim [${moment().format('HH:mm:ss:ms')}]} {bold {yellow WARN}}:  {gray ${context}}${line}\\n`},\n    error: function handle(moment, context, line) { return `{dim [${moment().format('HH:mm:ss:ms')}]} {bold {red ERROR}}: {gray ${context}}${line}\\n`}\n}\nlogger.setFormat(customClassic);\n```\nNote: confectionery does NOT automatically add line breaks. Please use `\\n` when designing formats.\n\n----\n### Custom Printing\nconfectionery provides a formatter to use when there is no logger, or the message needs a special format (mainly used in other modules.)\n\nExample: \n```js\nconfectionery.customPrint((arg1, arg2, arg3) =\u003e { return `{bold {white ${arg1}}} {gray ${arg2}} ${arg3}\\n`}, \"ARGUMENT 1\", \"ARGUMENT 2\", \"ARGUMENT 3\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfect1ondev%2Fconfectionery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfect1ondev%2Fconfectionery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfect1ondev%2Fconfectionery/lists"}