Context Data Provider
An API for injecting scoped metadata for log statements (either globally or on a per-request basis). Thiis class is not a public API and should never need to be invoked directly by application code.
Note that since this class (and any installed implementation sub-class) is loaded when the logging platform is loaded, care must be taken to avoid cyclic references during static initialisation. This means that no static fields or static initialization can reference fluent loggers or the logging platform (either directly or indirectly).
This is a service type
This type is considered a service type and implemenations may be loaded from the classpath via java.util.ServiceLoader provided the proper service metadata is included in the jar file containing the implementation. When creating an implementation of this class, you can provide serivce metadata (and thereby allow users to get your implementation just by including your jar file) by either manually including a
META-INF/services/com.google.common.flogger.context.ContextDataProvider file containing the name of your implementation class or by annotating your implementation class using @AutoService(ContextDataProvider.class). See the documentation of both and com.google.common.flogger.backend.system.DefaultPlatform for more information.
Functions
ScopedLoggingContext for some reason.null if no such scope was bound to this context.