LogLevelMap

public final class LogLevelMap

A hierarchical mapping from logger name to Level used to override the configured log level during debugging. This class is designed to allow efficient (i.e. zero-allocation) resolution of the log level for a given logger.

This class is immutable and thread safe.

Types

Link copied to clipboard
public final class Builder
Builder for log level map which uses type safe class/package keys (but requires that they be present in the JVM at the time the map is created).

Functions

Link copied to clipboard
public static LogLevelMap.Builder builder()
Returns a new builder for constructing a LogLevelMap.
Link copied to clipboard
public static LogLevelMap create(Map<String, ? extends Level> map)
Returns a LogLevelMap whose entries correspond to the given map, and with the default value of Level.OFF.
public static LogLevelMap create(Level level)
Returns an empty LogLevelMap with a single default level which will apply to all loggers.
public static LogLevelMap create(Map<String, ? extends Level> map, Level defaultLevel)
Returns a LogLevelMap whose entries correspond to the given map.
Link copied to clipboard
public Level getLevel(String loggerName)
Returns the log level for the specified logger, matching the loggerName to an entry in the map, or the nearest parent in the naming hierarchy.
Link copied to clipboard
public LogLevelMap merge(LogLevelMap other)
Returns the union of this map with the given map.