{"id":27352276,"url":"https://github.com/sukovanej/effect-log","last_synced_at":"2025-04-12T20:54:57.209Z","repository":{"id":152786334,"uuid":"627091338","full_name":"sukovanej/effect-log","owner":"sukovanej","description":"Log batteries for effect-ts","archived":false,"fork":false,"pushed_at":"2024-12-02T10:21:07.000Z","size":2109,"stargazers_count":27,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T19:49:07.621Z","etag":null,"topics":["effect-ts","fp-ts","logging"],"latest_commit_sha":null,"homepage":"https://sukovanej.github.io/effect-log/","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/sukovanej.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-04-12T19:07:18.000Z","updated_at":"2024-12-02T10:21:11.000Z","dependencies_parsed_at":"2024-06-08T18:25:16.084Z","dependency_job_id":"868d8aa5-f2c6-4bba-a7ca-62320c5958f0","html_url":"https://github.com/sukovanej/effect-log","commit_stats":{"total_commits":332,"total_committers":4,"mean_commits":83.0,"dds":0.3644578313253012,"last_synced_commit":"d43fa7faa5d1b1ea2a6c0c07c309727dbfaae99a"},"previous_names":[],"tags_count":114,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukovanej%2Feffect-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukovanej%2Feffect-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukovanej%2Feffect-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukovanej%2Feffect-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukovanej","download_url":"https://codeload.github.com/sukovanej/effect-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586235,"owners_count":21128997,"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":["effect-ts","fp-ts","logging"],"created_at":"2025-04-12T20:54:53.533Z","updated_at":"2025-04-12T20:54:57.203Z","avatar_url":"https://github.com/sukovanej.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# effect-log\n\nLogging batteris for effect-ts.\n\n## Consider using the official `effect/Logger` instead\n\nMost of the functionality provided by this library is already present directly in the `effect`\npackage. In case of the pretty logger, you should strongly consider using the \n[Logger.pretty](https://effect-ts.github.io/effect/effect/Logger.ts.html#pretty) instead. And,\nin case of the JSON logger, consider using the\n[Logger.json](https://effect-ts.github.io/effect/effect/Logger.ts.html#json). Just be aware\nof few differences:\n\n- the `Logger.json` includes the log annotations in the `annotations` field, the `JsonLogger.layer()`\n  spreads the annotations into the root of the output JSON\n- the `Logger.json` outputs the message as an array into the `message` field, the `JsonLogger.layer()`\n  concatenates the message into a single string\n\nThese decisions about the output JSON format were motivated by the fact that I'm targetting\nthe Datadog platform. If you want the same output format, you can still achieve it by using\nthe [Logger.structuredLogger](https://effect-ts.github.io/effect/effect/Logger.ts.html#structuredlogger)\nand modifying the output using [Logger.map](https://effect-ts.github.io/effect/effect/Logger.ts.html#map).\n\n## [Pretty logger](examples/pretty-logger.ts)\n\nUse `PrettyLogger.make` to create the pretty logger or `PrettyLogger.layer` to\nobtain a layer replacing the default logger. Optionally, these functions\naccept an options object configuring what information gets\nto the output.\n\n```typescript\nimport { Effect, pipe } from \"effect\";\nimport { PrettyLogger } from \"effect-log\";\n\nimport { exampleEffect } from \"./example-logging-effect\";\n\n// These are the defaults. You can omit the argument\n// completely if you're okay with the defaults.\nconst logger = PrettyLog.layer({\n  showFiberId: true,\n  showTime: true,\n  showSpans: true,\n  enableColors: true,\n});\n\npipe(exampleEffect, Effect.provide(logger), Effect.runSync);\n```\n\n![pretty](assets/pretty.png)\n\n## [JSON logger](examples/json-logger.ts)\n\nUse `JsonLogger.make` to create the JSON logger or `JsonLogger.layer` to\nobtain a layer replacing the default loggger. Optionally, these functions\naccept an options object configuring what information gets\nto the output.\n\n```typescript\nimport { Effect, pipe } from \"effect\";\nimport { JsonLogger } from \"effect-log\";\n\nimport { exampleEffect } from \"./example-logging-effect\";\n\n// These are the defaults. You can omit the argument\n// completely if you're okay with the defaults.\nconst logger = JsonLogger.layer({\n  showFiberId: true,\n  showTime: true,\n  showSpans: true,\n  messageField: \"message\",\n});\n\npipe(exampleEffect, Effect.provide(logger), Effect.runSync);\n```\n\n![json](assets/json.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukovanej%2Feffect-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukovanej%2Feffect-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukovanej%2Feffect-log/lists"}