{"id":19904267,"url":"https://github.com/alloc/shared-log","last_synced_at":"2025-05-03T00:31:34.462Z","repository":{"id":57357996,"uuid":"357395897","full_name":"alloc/shared-log","owner":"alloc","description":"Decoupled logging for libraries","archived":false,"fork":false,"pushed_at":"2022-04-02T00:20:59.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T09:03:18.690Z","etag":null,"topics":["logging","nodejs"],"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/alloc.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}},"created_at":"2021-04-13T02:08:07.000Z","updated_at":"2022-01-03T19:45:29.000Z","dependencies_parsed_at":"2022-09-26T16:40:38.463Z","dependency_job_id":null,"html_url":"https://github.com/alloc/shared-log","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fshared-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fshared-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fshared-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fshared-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/shared-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126544,"owners_count":21698964,"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":["logging","nodejs"],"created_at":"2024-11-12T20:27:38.187Z","updated_at":"2025-05-03T00:31:32.852Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":["https://paypal.me/alecdotbiz"],"categories":[],"sub_categories":[],"readme":"# shared-log\n\n[![npm](https://img.shields.io/npm/v/shared-log.svg)](https://www.npmjs.com/package/shared-log)\n[![Bundle size](https://badgen.net/bundlephobia/min/shared-log)](https://bundlephobia.com/result?p=shared-log)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\n\u003e Decoupled logging for libraries\n\n\u0026nbsp;\n\n### Usage\n\nLibraries should import `shared-log` and treat it as write-only.\n\n\"Reading\" the log (via event listener) is reserved for the end user.\n\n```ts\nimport log from 'shared-log'\n\n// The log function is console.log by default\nlog('all arguments', 'are passed thru')\n\n// Log methods exist for each log level\nlog.error(new Error('ruh roh'))\nlog.warn(...)\nlog.info(...)\nlog.verbose(...)\nlog.debug(...)\n```\n\nThe end user hooks up their logging library of choice.\n\n```ts\nimport log from 'shared-log'\n\n// Listen to every log level\nlog.on('all', (level, args, filename) =\u003e {...})\n\n// or a specific log level\nlog.on('error', (args, filename) =\u003e {...})\n```\n\nIf the end user doesn't add a log listener, the `console` is used by default, but the `debug` and `verbose` log levels are ignored by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fshared-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Fshared-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fshared-log/lists"}