Package org.jitsi.utils.logging2
Class LogContext
-
- All Implemented Interfaces:
public final class LogContextMaintains a map of key-value pairs (both Strings) which holds arbitrary context to use as a prefix for log messages. Sub-contexts can be created and will inherit any context values from their ancestors' context.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringCONTEXT_START_TOKENpublic final static StringCONTEXT_END_TOKENprivate final StringformattedContext
-
Constructor Summary
Constructors Constructor Description LogContext(Map<String, String> context)LogContext()LogContext(String key, String value)
-
Method Summary
Modifier and Type Method Description final StringgetFormattedContext()The formatted String representing the total context (the combination of the ancestors' context and this context) final LogContextcreateSubContext(Map<String, String> childContextData)final UnitaddContext(String key, String value)final UnitaddContext(Map<String, String> addedContext)final UnitremoveContext(String key)StringtoString()-
-
Method Detail
-
getFormattedContext
final String getFormattedContext()
The formatted String representing the total context (the combination of the ancestors' context and this context)
-
createSubContext
@Synchronized() final LogContext createSubContext(Map<String, String> childContextData)
-
addContext
final Unit addContext(String key, String value)
-
addContext
@Synchronized() final Unit addContext(Map<String, String> addedContext)
-
removeContext
@Synchronized() final Unit removeContext(String key)
-
-
-
-