From c4aae9cf969aec5fafbde5595c3007c904d606cf Mon Sep 17 00:00:00 2001 From: Johannes Schickling Date: Sun, 24 Sep 2023 17:32:20 +0200 Subject: [PATCH] fix logging --- node-scripts/src/async-promises.ts | 4 ++-- node-scripts/src/fs-write-file.ts | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/node-scripts/src/async-promises.ts b/node-scripts/src/async-promises.ts index 72373d8..40a0a2c 100644 --- a/node-scripts/src/async-promises.ts +++ b/node-scripts/src/async-promises.ts @@ -1,5 +1,5 @@ import * as Node from '@effect/platform-node/Runtime' -import { Cause, Duration, Effect } from 'effect' +import { Duration, Effect } from 'effect' import { TaggedClass } from 'effect/Data' // --- HELPERS --- @@ -48,4 +48,4 @@ const main = Effect.gen(function* ($) { console.log('Got result 3:', result3) }) -Node.runMain(main.pipe(Effect.tapErrorCause((_) => Effect.log(Cause.pretty(_))))) +Node.runMain(main.pipe(Effect.tapErrorCause(Effect.log))) diff --git a/node-scripts/src/fs-write-file.ts b/node-scripts/src/fs-write-file.ts index 57244c9..6cf0926 100644 --- a/node-scripts/src/fs-write-file.ts +++ b/node-scripts/src/fs-write-file.ts @@ -1,7 +1,7 @@ import * as FS from '@effect/platform/FileSystem' import * as Node from '@effect/platform-node/Runtime' import * as NodeContext from '@effect/platform-node/NodeContext' -import { Cause, Effect } from 'effect' +import { Effect } from 'effect' const main = Effect.gen(function* ($) { const fs = yield* $(FS.FileSystem) @@ -12,9 +12,4 @@ const main = Effect.gen(function* ($) { console.log('Wrote file (output/fs-write-file.txt)') }) -Node.runMain( - main.pipe( - Effect.provideSomeLayer(NodeContext.layer), - Effect.tapErrorCause((_) => Effect.log(Cause.pretty(_))), - ), -) +Node.runMain(main.pipe(Effect.provideSomeLayer(NodeContext.layer), Effect.tapErrorCause(Effect.log)))