{"id":25006613,"url":"https://github.com/croct-tech/logging-js","last_synced_at":"2025-10-13T06:40:07.737Z","repository":{"id":36979172,"uuid":"475891334","full_name":"croct-tech/logging-js","owner":"croct-tech","description":"An interoperability layer for logging libraries.","archived":false,"fork":false,"pushed_at":"2025-09-29T03:28:19.000Z","size":1326,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-29T05:31:51.427Z","etag":null,"topics":["log","logger","logging"],"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/croct-tech.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":".github/CODEOWNERS","security":null,"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":"2022-03-30T13:28:06.000Z","updated_at":"2025-09-29T03:28:22.000Z","dependencies_parsed_at":"2023-12-07T02:18:49.813Z","dependency_job_id":"aaaa968d-0843-4035-8b16-46b8ea8cecd8","html_url":"https://github.com/croct-tech/logging-js","commit_stats":{"total_commits":171,"total_committers":6,"mean_commits":28.5,"dds":0.06432748538011701,"last_synced_commit":"5781b2f24762795858e1bc54ef06b273d37edf8e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/croct-tech/logging-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croct-tech%2Flogging-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croct-tech%2Flogging-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croct-tech%2Flogging-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croct-tech%2Flogging-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/croct-tech","download_url":"https://codeload.github.com/croct-tech/logging-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croct-tech%2Flogging-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013970,"owners_count":26085429,"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-10-13T02:00:06.723Z","response_time":61,"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":["log","logger","logging"],"created_at":"2025-02-05T01:50:23.082Z","updated_at":"2025-10-13T06:40:07.732Z","avatar_url":"https://github.com/croct-tech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://croct.com\"\u003e\n        \u003cimg src=\"https://cdn.croct.io/brand/logo/repo-icon-green.svg\" alt=\"Croct\" height=\"80\"/\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cstrong\u003eLogging\u003c/strong\u003e\n    \u003cbr /\u003e\n     An interoperability layer for logging libraries.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n        \u003ca href=\"https://www.npmjs.com/package/@croct/logging\"\u003e\u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/@croct/logging\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/croct-tech/logging-js/actions/workflows/validate-branch.yaml\"\u003e\u003cimg alt=\"Build\" src=\"https://github.com/croct-tech/logging-js/actions/workflows/validate-branch.yaml/badge.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://qlty.sh/gh/croct-tech/projects/logging-js\"\u003e\u003cimg src=\"https://qlty.sh/badges/8a8eb9ca-1b3b-44fb-842a-b0cae7cb7564/coverage.svg\" alt=\"Code Coverage\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://qlty.sh/gh/croct-tech/projects/logging-js\"\u003e\u003cimg src=\"https://qlty.sh/badges/8a8eb9ca-1b3b-44fb-842a-b0cae7cb7564/maintainability.svg\" alt=\"Maintainability\" /\u003e\u003c/a\u003e\n\u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/croct-tech/logging-js/releases\"\u003e📦 Releases\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/croct-tech/logging-js/issues/new?labels=bug\u0026template=bug-report.md\"\u003e🐞 Report Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/croct-tech/logging-js/issues/new?labels=enhancement\u0026template=feature-request.md\"\u003e✨ Request Feature\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nWe recommend using [NPM](https://www.npmjs.com) to install the package:\n\n```sh\nnpm install @croct/logging\n```\n\n## Basic usage\n\nThe following example shows how to log a message using the [`ConsoleLogger`](src/consoleLogger.ts):\n\n```ts\nimport {ConsoleLogger, LogLevel} from '@croct/logging';\n\nconst logger = new ConsoleLogger();\n\nlogger.log({\n    level: LogLevel.ERROR,\n    message: 'Unable to load data',\n    details: { \n        cause: 'The request failed',\n        status: 500,\n    },\n});\n```\n\n## Implementations\n\nThis package provides the following implementations:\n\n- [SuppressedLogger](src/suppressedLogger.ts)  \n  A logger that does not log anything, but can be used to suppress logging where desired.\n- [ConsoleLogger](src/consoleLogger.ts)  \n  A logger that writes to the console using the appropriate console API semantics.\n- [PrefixedLogger](src/prefixedLogger.ts)  \n  A logger that prepends a prefix to all log messages.\n- [InMemoryLogger](src/inMemoryLogger.ts)  \n  A logger that stores all log messages in memory.\n- [MultiLogger](src/multiLogger.ts)  \n  A logger that sends logs to multiple loggers.\n- [FilteredLogger](src/filteredLogger.ts)  \n  A logger wrapper that filters logs according to log level.\n\n## Utilities\n\nBecause JavaScript allows throwing pretty much anything, proving more information about the error \noften requires some boilerplate code. \n\nThis package provides a few utilities to make it easier to log errors:\n\n- [extractErrorMessage](src/utilities.ts)  \n  Extracts the error message from an unknown caught error.\n\n## Contributing\n\nContributions to the package are always welcome!\n\n- Report any bugs or issues on the [issue tracker](https://github.com/croct-tech/logging-js/issues).\n- For major changes, please [open an issue](https://github.com/croct-tech/logging-js/issues) first to discuss what you would like to change.\n- Please make sure to update tests as appropriate.\n\n## Testing\n\nBefore running the test suites, the development dependencies must be installed:\n\n```sh\nnpm install\n```\n\nThen, to run all tests:\n\n```sh\nnpm run test\n```\n\nRun the following command to check the code against the style guide:\n\n```sh\nnpm run lint\n```\n\n## Building\n\nBefore building the project, the dependencies must be installed:\n\n```sh\nnpm install\n```\n\nThen, to build the CommonJS module:\n\n```sh\nnpm run build\n```\n\n## License\n\nCopyright © 2015-2022 Croct Limited, All Rights Reserved.\n\nAll information contained herein is, and remains the property of Croct Limited. The intellectual, design and technical concepts contained herein are proprietary to Croct Limited s and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden unless prior written permission is obtained from Croct Limited.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroct-tech%2Flogging-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcroct-tech%2Flogging-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroct-tech%2Flogging-js/lists"}