Platform

public abstract class Platform

Platform abstraction layer required to allow fluent logger implementations to work on differing Java platforms (such as Android or GWT). The Platform class is responsible for providing any platform specific APIs, including the mechanism by which logging backends are created.

To enable an additional logging platform implementation, the class name should be added to the list of available platforms before the default platform (which must always be at the end). Platform implementation classes must subclass Platform and have a public, no-argument constructor. Platform instances are created on first-use of a fluent logger and platform implementors must take care to avoid cycles during initialization and re-entrant behaviour.

Constructors

Link copied to clipboard
public void Platform()

Types

Link copied to clipboard
public abstract class LogCallerFinder
API for determining the logging class and log statement sites, return from getCallerFinder.

Functions

Link copied to clipboard
public static LoggerBackend getBackend(String className)
Returns a logger backend of the given class name for use by a Fluent Logger.
Link copied to clipboard
protected abstract LoggerBackend getBackendImpl(String className)
Link copied to clipboard
Returns the API for obtaining caller information about loggers and logging classes.
Link copied to clipboard
Link copied to clipboard
public static String getConfigInfo()
Returns a human readable string describing the platform and its configuration.
Link copied to clipboard
protected abstract String getConfigInfoImpl()
Link copied to clipboard
Returns the singleton ContextDataProvider from which a ScopedLoggingContext can be obtained.
Link copied to clipboard
public static int getCurrentRecursionDepth()
Returns the current depth of recursion for logging in the current thread.
Link copied to clipboard
public static long getCurrentTimeNanos()
Returns the current time from the epoch (00:00 1st Jan, 1970) with nanosecond granularity.
Link copied to clipboard
protected long getCurrentTimeNanosImpl()
Link copied to clipboard
public static Metadata getInjectedMetadata()
Returns Metadata from with the current context to be injected into log statements.
Link copied to clipboard
public static Tags getInjectedTags()
Returns Tags from with the current context to be injected into log statements.
Link copied to clipboard
public static boolean shouldForceLogging(String loggerName, Level level, boolean isEnabled)
Returns whether the given logger should have logging forced at the specified level.