{"id":16419184,"url":"https://github.com/cameronhunter/debug-logger","last_synced_at":"2025-08-09T12:40:35.395Z","repository":{"id":145461586,"uuid":"553762925","full_name":"cameronhunter/debug-logger","owner":"cameronhunter","description":"A TypeScript decorator for classes that logs all method usages","archived":false,"fork":false,"pushed_at":"2022-10-18T18:50:26.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T16:04:08.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cameronhunter.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-10-18T18:21:33.000Z","updated_at":"2024-11-02T14:58:08.000Z","dependencies_parsed_at":"2023-06-05T05:00:21.848Z","dependency_job_id":null,"html_url":"https://github.com/cameronhunter/debug-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cameronhunter/debug-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fdebug-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fdebug-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fdebug-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fdebug-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronhunter","download_url":"https://codeload.github.com/cameronhunter/debug-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fdebug-logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269579085,"owners_count":24441361,"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-09T02:00:10.424Z","response_time":111,"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":[],"created_at":"2024-10-11T07:16:11.380Z","updated_at":"2025-08-09T12:40:35.347Z","avatar_url":"https://github.com/cameronhunter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @cameronhunter/debug-logger\n\nA TypeScript decorator for classes that logs all method usages using the [`debug`](https://www.npmjs.com/package/debug)\npackage. Logging is enabled using the `DEBUG` environment variable – see the\n[`debug`](https://www.npmjs.com/package/debug) package for details.\n\n## Examples\n\n### Simple usage\n\nThe decorator can be used directly and it will log to a namespace matching the class name it is decorating. An execution\nof `new HelloWorld().main('World')` below will result in `HelloWorld main(\"World\");` being logged.\n\n```ts\nimport DebugLogging from '@cameronhunter/debug-logger';\n\n@DebugLogging\nclass HelloWorld {\n  main(name: string) {\n    console.log(`Hello ${name}!`);\n  }\n}\n```\n\n### Using a custom namespace\n\nThe decorator also accepts an optional namespace that will be used in addition to the class name it is decorating. An\nexecution of `new HelloWorld().main('World')` below will result in `my-debug-namespace:HelloWorld main(\"World\");` being\nlogged.\n\n```ts\nimport DebugLogging from '@cameronhunter/debug-logger';\n\n@DebugLogging('my-debug-namespace')\nclass HelloWorld {\n  main(name: string) {\n    console.log(`Hello ${name}!`);\n  }\n}\n```\n\n### Configuring a shared logger\n\nThe decorator can be preconfigured and shared. For example, we can configure a debug logger with a custom namespace and\nexport it for use around an application. An execution of `new HelloWorld().main('World')` below will result in\n`my-namespace:HelloWorld main(\"World\");` being logged.\n\n```ts\nimport DebugLogger from '@cameronhunter/debug-logger';\n\nconst CustomLogger = DebugLogger('my-namespace');\n\n@CustomLogger\nclass HelloWorld {\n  main(name: string) {\n    console.log(`Hello ${name}!`);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fdebug-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronhunter%2Fdebug-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fdebug-logger/lists"}