Improving Logging and Error Handling in User Verification

Am I doing logging right? This feels a bit annoying:
        Effect.tap(({ username, id }) =>
          Effect.log(`User found: ${username} with id: ${id}`)
        ),
        Effect.mapError(() => UserNotFound.make(username)),
        Effect.tap((user) => verifyPassword(password, user.password)),
        Effect.tap((user) =>
          Effect.log(`Password verified for ${user.username}`)
        ),

I have to tap in order to log, because I can not log inside any function because I need to return the effect from the log for it to happen.
Was this page helpful?