Skip to content

Commit c21ffde

Browse files
committed
feat: update effect to enable arbitrary annotation values
1 parent 4b61ba6 commit c21ffde

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

.changeset/clean-jeans-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect-log": minor
3+
---
4+
5+
Update effect. Enables arbitrary annotation values.

examples/example-logging-effect.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const exampleEffect = pipe(
1010
Effect.logError("Something's super fishy"),
1111
Effect.annotateLogs("life", "is awesome"),
1212
Effect.annotateLogs("sometimes", "not that awesome"),
13+
Effect.annotateLogs("json", { value: 1, another: { hello: [3, 2, 1] } }),
1314
),
1415
),
1516
Effect.annotateLogs("rootCause", "milan"),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"devDependencies": {
4141
"@changesets/cli": "^2.26.2",
4242
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
43-
"effect": "2.0.0-next.47",
43+
"effect": "2.0.0-next.48",
4444
"prettier": "^3.0.3",
4545
"tsup": "^7.2.0",
4646
"tsx": "^3.13.0",

pnpm-lock.yaml

Lines changed: 23 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pretty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const makePrettyLogger = (options?: Partial<PrettyLoggerOptions>) =>
8383
if (!HashMap.isEmpty(annotations)) {
8484
const text = HashMap.reduce(annotations, [] as string[], (acc, v, k) => [
8585
...acc,
86-
`${WHITE}"${k}"${RESET}: "${v}"`,
86+
`${WHITE}"${k}"${RESET}: ${serializeUnknown(v)}`,
8787
]);
8888
console.log(`ᐉ ${DIM}{${RESET} ${text.join(", ")} ${DIM}}${RESET}`);
8989
}

0 commit comments

Comments
 (0)