Logger
Config & IO
Leveled print-debugging. Debug.inspect is unchanged and always prints.
A call below the active floor returns its value and prints nothing. The floor is the process level from configure, else SELM_LOG_LEVEL (debug, info, warn, or error), else info when SELM_ENV=prod, else debug.
Types
Level
type Level
= Debug
| Info
| Warn
| ErrorSeverity, lowest to highest.
Examples
Logger.InfoValues
debug
debug : String -> a -> aLog a tagged value at debug level, then return the value.
Examples
Logger.debug "user" userinfo
info : String -> a -> aLog a tagged value at info level, then return the value.
Examples
Logger.info "request" req.pathwarn
warn : String -> a -> aLog a tagged value at warn level, then return the value.
Examples
Logger.warn "retry" attempterror
error : String -> a -> aLog a tagged value at error level, then return the value.
Examples
Logger.error "fail" errlog
log : Level -> String -> a -> aLog a tagged value at the given level, then return the value.
Examples
Logger.log Logger.Info "ready" modelconfigure
configure : Level -> ()Set the minimum level for the current process.
Examples
Logger.configure Logger.Warnmetadata
metadata : List (String, String) -> ()Replace the key/value pairs printed after each line in the current process.
Examples
Logger.metadata [ ("request_id", id) ]