Enum LogLevel

  • All Implemented Interfaces:
    Serializable, Comparable<LogLevel>

    public enum LogLevel
    extends Enum<LogLevel>
    Represents log levels used within the Proxy-WASM ABI specification. These levels correspond to the values expected by the host environment when logging messages from a WASM module.

    Converted from Go's LogLevel type in the proxy-wasm-go-sdk.

    • Enum Constant Detail

      • TRACE

        public static final LogLevel TRACE
        Trace log level. Value: 0
      • DEBUG

        public static final LogLevel DEBUG
        Debug log level. Value: 1
      • INFO

        public static final LogLevel INFO
        Info log level. Value: 2
      • WARN

        public static final LogLevel WARN
        Warn log level. Value: 3
      • ERROR

        public static final LogLevel ERROR
        Error log level. Value: 4
      • CRITICAL

        public static final LogLevel CRITICAL
        Critical log level. Value: 5
    • Method Detail

      • values

        public static LogLevel[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (LogLevel c : LogLevel.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LogLevel valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • value

        public int value()
        Get the integer value of this log level as defined by the Proxy-WASM ABI.
        Returns:
        The integer value representing the log level.
      • fromInt

        public static LogLevel fromInt​(int value)
        Convert an integer value to its corresponding LogLevel enum constant. This is useful for interpreting log level values received from the host or specified in configurations.
        Parameters:
        value - The integer value to convert.
        Returns:
        The corresponding LogLevel enum constant.
        Throws:
        IllegalArgumentException - if the provided integer value does not match any known LogLevel.