{"id":22938436,"url":"https://github.com/jacraig/woodchuck","last_synced_at":"2026-04-02T23:52:40.307Z","repository":{"id":218416063,"uuid":"740258107","full_name":"JaCraig/Woodchuck","owner":"JaCraig","description":"WoodChuck is a lightweight and extensible logging library for TypeScript, designed to simplify the process of logging messages in your applications. With customizable logging levels, type safety, and support for plugins, WoodChuck offers a flexible solution to track and understand your application's behavior.","archived":false,"fork":false,"pushed_at":"2026-02-24T00:42:55.000Z","size":3957,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-24T07:40:14.305Z","etag":null,"topics":["logging","logging-framework"],"latest_commit_sha":null,"homepage":"https://jacraig.github.io/Woodchuck/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaCraig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-08T00:48:15.000Z","updated_at":"2026-02-24T00:42:56.000Z","dependencies_parsed_at":"2025-05-26T18:24:41.627Z","dependency_job_id":"fb2a3346-c686-4d97-afde-29a87f260565","html_url":"https://github.com/JaCraig/Woodchuck","commit_stats":null,"previous_names":["jacraig/woodchuck"],"tags_count":110,"template":false,"template_full_name":null,"purl":"pkg:github/JaCraig/Woodchuck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FWoodchuck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FWoodchuck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FWoodchuck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FWoodchuck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaCraig","download_url":"https://codeload.github.com/JaCraig/Woodchuck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FWoodchuck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30184888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["logging","logging-framework"],"created_at":"2024-12-14T12:17:57.310Z","updated_at":"2026-03-06T16:05:20.393Z","avatar_url":"https://github.com/JaCraig.png","language":"TypeScript","readme":"# WoodChuck - Logging Library\n\n[![NPM Publish](https://github.com/JaCraig/Woodchuck/actions/workflows/node-publish.yml/badge.svg)](https://github.com/JaCraig/Woodchuck/actions/workflows/node-publish.yml)\n\nWoodChuck is a versatile logging library for TypeScript/JavaScript that simplifies the process of logging messages within your applications and is built with structured event data at its heart. It provides a flexible and extensible logging framework to help you track and understand the flow of your application.\n\n## Features\n\n- **Easy Integration**: Simple setup for quick integration into your projects.\n- **Customizable Logging Levels**: Define and use different logging levels to categorize and filter messages.\n- **Extensible Plugins**: Extend functionality with plugins for various output formats and destinations.\n- **Structured Logging**: Log structured event data to make it easier to analyze and understand.\n- **Flexible Configuration**: Configure the logger with a fluent interface to customize the logging experience.\n\n## Installation\n\n```bash\nnpm i @jacraig/woodchuck\n```\n\n## Usage\n\n1. Configure the logger with a sink to output to.\n\n```typescript\nimport { Logger, ConsoleSink } from \"@jacraig/woodchuck\";\n\nLogger.configure().minimumLevel(\"Information\").writeTo(new ConsoleSink());\n```\n\n2. Log messages with different levels:\n\n```typescript\nLogger.verbose(\"This is a verbose message: {key}\", { key: \"value\" });\nLogger.debug(\"This is a debug message: {key}\", { key: \"value\" });\nLogger.information(\"This is an information message: {key}\", { key: \"value\" });\nLogger.warning(\"This is a warning message: {key}\", { key: \"value\" });\nLogger.error(\n  \"This is an error message: {key}\",\n  { key: \"value\" },\n  new Error(\"This is an error\")\n);\nLogger.fatal(\n  \"This is a fatal message: {key}\",\n  { key: \"value\" },\n  new Error(\"This is a fatal error\")\n);\n```\n\n3. Customize the logger with plugins:\n\n```typescript\nLogger.configure()\n  .enrichWith(new UserAgentEnricher())\n  .enrichWith(new UrlEnricher())\n  .enrichWith(new CallerEnricher())\n  .formatUsing(new DefaultFormatter())\n  .minimumLevel(\"Information\")\n  .writeTo(new ConsoleSink());\n```\n\n4. Or build your own plugins:\n\n```typescript\nimport { LogEventEnricher, LogEvent } from \"@jacraig/woodchuck\";\n\nexport class MyCustomPlugin implements LogEventEnricher {\n  public enrich(logEvent: LogEvent): void {\n    logEvent.properties[\"myProperty\"] =\n      \"Something, something, something, dark side\";\n  }\n}\n```\n\n# Additional Usage Examples\n\n## Multiple Sinks\n\n```typescript\nimport {\n  Logger,\n  ConsoleSink,\n  BatchedSink,\n  BatchedSinkOptions,\n} from \"@jacraig/woodchuck\";\n\nLogger.configure()\n  .minimumLevel(\"Debug\")\n  .writeTo(new ConsoleSink())\n  .writeTo(new BatchedSink(new ConsoleSink(), new BatchedSinkOptions()));\n```\n\n## Async Sinks\n\nWoodChuck supports asynchronous sinks (e.g., HTTP or file sinks that return a Promise). Async sinks are treated as \"fire-and-forget\": the library will call the sink's `write` method, and if a Promise is returned it will attach an internal rejection handler so unhandled rejections do not propagate. This keeps the API non-blocking and backwards compatible with synchronous sinks.\n\nExample (pseudo HTTP sink):\n\n```typescript\nclass HttpSink {\n  constructor(private url: string) {}\n  public write(event) {\n    // return a Promise so this sink runs asynchronously\n    return fetch(this.url, { method: \"POST\", body: JSON.stringify(event) });\n  }\n}\n\nLogger.configure().writeTo(new HttpSink(\"https://logs.example.com/ingest\"));\n```\n\nWhen using `BatchedSink`, you can call `flush()` or `close()` to ensure buffered events are emitted before shutdown.\n\n## Custom Enricher\n\n```typescript\nimport { Logger, LogEventEnricher } from \"@jacraig/woodchuck\";\n\nclass MyEnricher implements LogEventEnricher {\n  enrich(event) {\n    event.properties[\"custom\"] = \"myValue\";\n  }\n}\n\nLogger.configure().enrichWith(new MyEnricher()).writeTo(new ConsoleSink());\n\nLogger.debug(\"With custom property\");\n```\n\n## Custom Filter\n\n```typescript\nimport { Logger, LogFilter } from \"@jacraig/woodchuck\";\n\nclass OnlyErrorsFilter implements LogFilter {\n  filter(event) {\n    return event.level === \"Error\";\n  }\n}\n\nLogger.configure().filter(new OnlyErrorsFilter()).writeTo(new ConsoleSink());\n\nLogger.error(\"This will be logged\");\nLogger.information(\"This will NOT be logged\");\n```\n\n## Logging with Custom Properties\n\n```typescript\nLogger.information(\"User logged in\", { userId: 123, userName: \"alice\" });\n```\n\n# Contributing\n\nIf you'd like to contribute to WoodChuck, please follow our [contribution guidelines](https://github.com/JaCraig/Woodchuck/blob/main/CONTRIBUTING.md).\n\n# License\n\nWoodChuck is licensed under the [Apache 2 License](https://github.com/JaCraig/Woodchuck/blob/main/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Fwoodchuck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacraig%2Fwoodchuck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Fwoodchuck/lists"}