Package: effect
Module: Effect
Logs one or more messages at the WARNING level.
Example (Logging warnings)
import { Effect } from "effect"
const program = Effect.gen(function*() {
yield* Effect.logWarning("API rate limit approaching")
yield* Effect.logWarning("Retries remaining:", 2, "Operation:", "fetchData")
// Useful for non-critical issues
const deprecated = true
if (deprecated) {
yield* Effect.logWarning("Using deprecated API endpoint")
}
})
Effect.runPromise(program)
// Output:
// timestamp=2023-... level=WARN message="API rate limit approaching"
// timestamp=2023-... level=WARN message="Retries remaining: 2 Operation: fetchData"
// timestamp=2023-... level=WARN message="Using deprecated API endpoint"
Signature
declare const logWarning: (...message: ReadonlyArray<any>) => Effect<void>
Since v2.0.0