{"id":21531925,"url":"https://github.com/matrixai/js-logger","last_synced_at":"2025-07-22T13:03:25.572Z","repository":{"id":37397946,"uuid":"338925282","full_name":"MatrixAI/js-logger","owner":"MatrixAI","description":"TypeScript/JavaScript Logger Library","archived":false,"fork":false,"pushed_at":"2025-04-22T02:42:46.000Z","size":1059,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":7,"default_branch":"staging","last_synced_at":"2025-04-22T04:23:28.239Z","etag":null,"topics":["logging","structured-logging","tracing"],"latest_commit_sha":null,"homepage":"https://polykey.com","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/MatrixAI.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,"zenodo":null}},"created_at":"2021-02-14T23:38:36.000Z","updated_at":"2025-04-17T07:01:36.000Z","dependencies_parsed_at":"2024-06-21T02:15:38.604Z","dependency_job_id":"52de5a9d-f3d9-42f1-ba1e-81cb6ef3fd7b","html_url":"https://github.com/MatrixAI/js-logger","commit_stats":{"total_commits":75,"total_committers":5,"mean_commits":15.0,"dds":0.24,"last_synced_commit":"c83ceba578ff5b5911e175cdd10e9c2fa7f585d5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":"MatrixAI/TypeScript-Demo-Lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAI","download_url":"https://codeload.github.com/MatrixAI/js-logger/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251336652,"owners_count":21573241,"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","structured-logging","tracing"],"created_at":"2024-11-24T02:18:12.715Z","updated_at":"2025-07-22T13:03:25.563Z","avatar_url":"https://github.com/MatrixAI.png","language":"TypeScript","readme":"# js-logger\n\nThis library provides a JavaScript/TypeScript logger inspired by Python's\nlogger.\n\n- Simple logging with default handlers supporting `console.log`,\n  `console.error`, and `process.stderr`.\n- Fast, logging level checks or log filters are applied **before** log records\n  are created\n- Complex log records properties support lazy evaluation, so they evaluated only\n  when they need to be rendered\n- Flexible composition of loggers, handlers and formatters\n- Custom formatting using template literals\n- Supports structured logging through a JSON formatter\n- Supports hierarchical logging through parent-child logger graph\n- CI/CD tests on Linux, MacOS and Windows\n- Zero runtime dependencies!\n- Comprehensive continuous benchmarks in CI/CD\n\n## Installation\n\n```sh\nnpm install --save @matrixai/logger\n```\n\n## Usage\n\n```ts\nimport Logger, { LogLevel, StreamHandler, formatting } from '@matrixai/logger';\n\nconst logger = new Logger('root', LogLevel.INFO, [\n  new StreamHandler(\n    formatting.format`${formatting.date}:${formatting.level}:${formatting.key}:${formatting.msg}:${formatting.data}`,\n  ),\n]);\n\nlogger.debug('Hello world', { a: { b: [123, 456] } });\nlogger.info('Hello world', { 123: { b: [123, 456] } });\nlogger.warn('Hello world', { lazy: () =\u003e 'string' });\nlogger.error('Hello world', formatting.format`my custom format`);\n\nconst loggerChild = logger.getChild('child');\n\nloggerChild.info(\n  'Hello world',\n  { 123: { b: [123, 456] } },\n  formatting.format`${formatting.keys}:${formatting.msg}:${formatting.data}`,\n);\n```\n\nThere's lots more options available in the source code. See the docs and see the\nsource code for more details.\n\n## Development\n\nRun `nix develop`, and once you're inside, you can use:\n\n```sh\n# install (or reinstall packages from package.json)\nnpm install\n# build the dist\nnpm run build\n# run the repl (this allows you to import from ./src)\nnpm run tsx\n# run the tests\nnpm run test\n# lint the source code\nnpm run lint\n# automatically fix the source\nnpm run lintfix\n```\n\n### Docs Generation\n\n```sh\nnpm run docs\n```\n\nSee the docs at: https://matrixai.github.io/js-logger/\n\n### Publishing\n\nPublishing is handled automatically by the staging pipeline.\n\nPrerelease:\n\n```sh\n# npm login\nnpm version prepatch --preid alpha # premajor/preminor/prepatch\ngit push --follow-tags\n```\n\nRelease:\n\n```sh\n# npm login\nnpm version patch # major/minor/patch\ngit push --follow-tags\n```\n\nManually:\n\n```sh\n# npm login\nnpm version patch # major/minor/patch\nnpm run build\nnpm publish --access public\ngit push\ngit push --tags\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fjs-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixai%2Fjs-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fjs-logger/lists"}