Skip to content

Commit

Permalink
feat: update effect to enable arbitrary annotation values
Browse files Browse the repository at this point in the history
  • Loading branch information
sukovanej committed Oct 10, 2023
1 parent 4b61ba6 commit 34b492c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-jeans-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect-log": minor
---

Update effect. Enables arbitrary annotation values.
1 change: 1 addition & 0 deletions examples/example-logging-effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const exampleEffect = pipe(
Effect.logError("Something's super fishy"),
Effect.annotateLogs("life", "is awesome"),
Effect.annotateLogs("sometimes", "not that awesome"),
Effect.annotateLogs("json", { value: 1, another: { hello: [3, 2, 1] } }),
),
),
Effect.annotateLogs("rootCause", "milan"),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"effect": "2.0.0-next.47",
"effect": "2.0.0-next.48",
"prettier": "^3.0.3",
"tsup": "^7.2.0",
"tsx": "^3.13.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"peerDependencies": {
"effect": "2.0.0-next.47"
"effect": "2.0.0-next.48"
}
}
40 changes: 23 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pretty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const makePrettyLogger = (options?: Partial<PrettyLoggerOptions>) =>
if (!HashMap.isEmpty(annotations)) {
const text = HashMap.reduce(annotations, [] as string[], (acc, v, k) => [
...acc,
`${WHITE}"${k}"${RESET}: "${v}"`,
`${WHITE}"${k}"${RESET}: ${serializeUnknown(v)}`,
]);
console.log(`ᐉ ${DIM}{${RESET} ${text.join(", ")} ${DIM}}${RESET}`);
}
Expand Down

0 comments on commit 34b492c

Please sign in to comment.