Hyperlinkv0.8.0-beta.28

Console

Console.countconsteffect/Console.ts:176
(label?: string): Effect.Effect<void>

Logs and increments the counter associated with label, using the console's default counter when no label is provided.

Example (Counting repeated calls)

import { Console, Effect } from "effect"

const program = Effect.gen(function*() {
  yield* Console.count("my-counter")
  yield* Console.count("my-counter") // Will show: my-counter: 2
  yield* Console.count() // Default counter
})
accessors
Source effect/Console.ts:1766 lines
export const count = (label?: string): Effect.Effect<void> =>
  consoleWith((console) =>
    effect.sync(() => {
      console.count(label)
    })
  )