Package: effect
Module: LogLevel
Represents every level used by Effect logging, including concrete message
severities and the All and None sentinel levels.
When to use
Use to type values that may be either concrete log message severities or logging configuration sentinels.
Details
The levels are ordered from most severe to least severe:
All - Special level that allows all messagesFatal - System is unusable, immediate attention requiredError - Error conditions that should be investigatedWarn - Warning conditions that may indicate problemsInfo - Informational messages about normal operationDebug - Debug information useful during developmentTrace - Very detailed trace informationNone - Special level that suppresses all messagesExample (Using log levels)
import { Effect } from "effect"
// Using log levels with Effect logging
const program = Effect.gen(function*() {
yield* Effect.logFatal("System failure")
yield* Effect.logError("Database error")
yield* Effect.logWarning("High memory usage")
yield* Effect.logInfo("User logged in")
yield* Effect.logDebug("Processing request")
yield* Effect.logTrace("Variable state")
})
// Type-safe log level variables
const errorLevel = "Error" // LogLevel
const debugLevel = "Debug" // LogLevel
Signature
type LogLevel = "All" | "Fatal" | "Error" | "Warn" | "Info" | "Debug" | "Trace" | "None"
Since v2.0.0