Class DefaultPlatform
- java.lang.Object
-
- com.google.common.flogger.backend.Platform
-
- com.google.common.flogger.backend.system.DefaultPlatform
-
public class DefaultPlatform extends com.google.common.flogger.backend.PlatformThe default fluent logger platform for a server-side Java environment.This class allows configuration via a number of service types. A single instance of each service type may be provided, either via the classpath using service providers (see
ServiceLoader) or by system property. For most users, configuring one of these should just require including the appropriate dependency.If set, the system property for each service type takes precedence over any implementations that may be found on the classpath. The value of the system property is expected to be of one of two forms:
- A fully-qualified class name: In this case, the platform will attempt to get an
instance of that class by invoking the public no-arg constructor. If the class defines a
public static no-arg
getInstancemethod, the platform will call that instead. Note: Support forgetInstanceis only provided to facilitate transition from older service implementations that include agetInstancemethod and will likely be removed in the future. - A fully-qualified class name followed by "#" and the name of a static method: In this case, the platform will attempt to get an instance of that class by invoking either the named no-arg static method or the public no-arg constructor. Note: This option exists only for compatibility with previous Flogger behavior and may be removed in the future; service implementations should prefer providing a no-arg public constructor rather than a static method and system properties should prefer only including the class name.
The services used by this platform are the following:
Service Type System Property Default BackendFactoryflogger.backend_factorySimpleBackendFactory, ajava.util.loggingbackendContextDataProviderflogger.logging_contextA no-op ContextDataProviderClockflogger.clockSystemClock, a millisecond-precision clock - A fully-qualified class name: In this case, the platform will attempt to get an
instance of that class by invoking the public no-arg constructor. If the class defines a
public static no-arg
-
-
Constructor Summary
Constructors Constructor Description DefaultPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.flogger.backend.LoggerBackendgetBackendImpl(java.lang.String className)protected com.google.common.flogger.backend.Platform.LogCallerFindergetCallerFinderImpl()protected java.lang.StringgetConfigInfoImpl()protected com.google.common.flogger.context.ContextDataProvidergetContextDataProviderImpl()protected longgetCurrentTimeNanosImpl()
-
-
-
Method Detail
-
getCallerFinderImpl
protected com.google.common.flogger.backend.Platform.LogCallerFinder getCallerFinderImpl()
- Specified by:
getCallerFinderImplin classcom.google.common.flogger.backend.Platform
-
getBackendImpl
protected com.google.common.flogger.backend.LoggerBackend getBackendImpl(java.lang.String className)
- Specified by:
getBackendImplin classcom.google.common.flogger.backend.Platform
-
getContextDataProviderImpl
protected com.google.common.flogger.context.ContextDataProvider getContextDataProviderImpl()
- Overrides:
getContextDataProviderImplin classcom.google.common.flogger.backend.Platform
-
getCurrentTimeNanosImpl
protected long getCurrentTimeNanosImpl()
- Overrides:
getCurrentTimeNanosImplin classcom.google.common.flogger.backend.Platform
-
getConfigInfoImpl
protected java.lang.String getConfigInfoImpl()
- Specified by:
getConfigInfoImplin classcom.google.common.flogger.backend.Platform
-
-