{"id":15018130,"url":"https://github.com/probot/pino","last_synced_at":"2025-05-07T15:23:27.083Z","repository":{"id":37072269,"uuid":"287506357","full_name":"probot/pino","owner":"probot","description":"🛠️ formatting and error captioning for probot logs","archived":false,"fork":false,"pushed_at":"2025-04-29T16:01:58.000Z","size":1041,"stargazers_count":9,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T17:22:35.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/probot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-08-14T10:24:59.000Z","updated_at":"2025-04-29T16:02:01.000Z","dependencies_parsed_at":"2024-05-13T17:33:14.557Z","dependency_job_id":"6994fb56-7ab5-44b8-adc8-c7e225d8a8ca","html_url":"https://github.com/probot/pino","commit_stats":{"total_commits":207,"total_committers":8,"mean_commits":25.875,"dds":"0.32367149758454106","last_synced_commit":"03be09674cd8bf56996986d3141adddb683c2981"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fpino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fpino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fpino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fpino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/probot","download_url":"https://codeload.github.com/probot/pino/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252903255,"owners_count":21822405,"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":[],"created_at":"2024-09-24T19:51:29.278Z","updated_at":"2025-05-07T15:23:27.065Z","avatar_url":"https://github.com/probot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@probot/pino`\n\n\u003e formats [pino](https://github.com/pinojs/pino) logs and sends errors to [Sentry](https://sentry.io)\n\n## About\n\n`@probot/pino` is currently built into `probot`, you don't need to manually pipe probot's logs into it. It will be easy to move it out of `probot` in future though, and give people a simple way to recover the logging behavior if they wish, or to replace it with another [pino transport](https://getpino.io/#/docs/transports)\n\n## CLI Usage\n\n```\nnode my-script.js | pino-probot\n```\n\nYou can test the environment variables by setting them inline\n\n```\nnode my-script.js | LOG_FORMAT=json pino-probot\n```\n\n## Programmatic usage\n\n`@probot/pino` exports a `getTransformStream()` method which can be passed as 2nd argument to `pino()`\n\n```js\nimport pino from \"pino\";\nimport { getTransformStream } from \"@probot/pino\";\n\nconst log = pino(\n  {\n    name: \"probot\",\n  },\n  getTransformStream(),\n);\n```\n\nThis won't log anything to stdout though. In order to pass the formatted logs back to stdout, do the following\n\n```js\nimport pino from \"pino\";\nimport { getTransformStream } from \"@probot/pino\";\n\nconst transform = getTransformStream();\ntransform.pipe(pino.destination(1));\nconst log = pino(\n  {\n    name: \"probot\",\n  },\n  transform,\n);\n```\n\nWith custom options:\n\n```js\nconst transform = getTransformStream({\n  logFormat: \"json\",\n  logLevelInString: true,\n  sentryDsn: \"http://username@example.com/1234\",\n});\n```\n\n### Options\n\nThe `pino-probot` binary can be configured using environment variables, while the `getTransformStream()` accepts an object with according keys\n\n| Environment Varibale  | Option             | Description                                                                                                                                                                                              |\n| --------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `LOG_FORMAT`          | `logFormat`        | Set to `pretty` or `json`. When set to `pretty`, logs are formatted for human readability. Setting to `json` logs using JSON objects. Defaults to `pretty`                                               |\n| `LOG_LEVEL_IN_STRING` | `logLevelInString` | By default, when using the `json` format, the level printed in the log records is an int (`10`, `20`, ..). This option tells the logger to print level as a string: `{\"level\": \"info\"}`. Default `false` |\n| `SENTRY_DSN`          | `sentryDsn`        | Set to a [Sentry](https://sentry.io/) DSN to report all errors thrown by your app. \u003cp\u003e_(Example: `https://1234abcd@sentry.io/12345`)_\u003c/p\u003e                                                                |\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobot%2Fpino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprobot%2Fpino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobot%2Fpino/lists"}