Skip to content

Function: setLogLevel()

ts
function setLogLevel(
  level:
    | "EMERG"
    | "ALERT"
    | "CRIT"
    | "ERROR"
    | "WARNING"
    | "NOTICE"
    | "INFO"
    | "DEBUG",
): void;

Sets the log level for the logger.

Parameters

ParameterTypeDescription
level| "EMERG" | "ALERT" | "CRIT" | "ERROR" | "WARNING" | "NOTICE" | "INFO" | "DEBUG"The log level to set. Can be one of the following: - EMERG or emerg - ALERT or alert - CRIT or crit - ERROR or error - WARNING or warning - NOTICE or notice - INFO or info - DEBUG or debug

Returns

void

Remarks

You can also set window.SWARM_LOG_LEVEL or globalThis.SWARM_LOG_LEVEL to the same values to set the log level globally before initializing any of the Swarm modules.