FluentLogger2

public final class FluentLogger2 extends AbstractLogger<API>

The default implementation of AbstractLogger which returns the basic FloggerApi and uses the default parser and system configured backend.

Note that when extending the logging API or specifying a new parser, you will need to create a new logger class (rather than extending this one). Unlike the LogContext class, which must be extended in order to modify the logging API, this class is not generified and thus cannot be modified to produce a different logging API.

The choice to prevent direct extension of loggers was made deliberately to ensure that users of a specific logger implementation always get the same behavior.

See also

<a href="https://github.com/google/flogger/blob/cb9e836a897d36a78309ee8badf5cad4e6a2d3d8/api/src/main/java/com/google/common/flogger/FluentLogger.java">

Original Java code of Google Flogger

Constructors

Link copied to clipboard
public void FluentLogger2(LoggerBackend backend)
Creates a new fluent logger instance with the specified backend.

Types

Link copied to clipboard
public interface Api implements FloggerApi<API>
The non-wildcard, fully specified, logging API for this logger.

Functions

Link copied to clipboard
public FluentLogger2.Api at(Level level)
Returns a fluent logging API appropriate for the specified log level.
Link copied to clipboard
Returns a new logger instance which parses log messages using printf format for the enclosing class using the system default logging backend.

Inherited functions

Link copied to clipboard
public final API atConfig()
A convenience method for at(CONFIG).
Link copied to clipboard
public final API atFine()
A convenience method for at(FINE).
Link copied to clipboard
public final API atFiner()
A convenience method for at(FINER).
Link copied to clipboard
public final API atFinest()
A convenience method for at(FINEST).
Link copied to clipboard
public final API atInfo()
A convenience method for at(INFO).
Link copied to clipboard
public final API atSevere()
A convenience method for at(SEVERE).
Link copied to clipboard
public final API atWarning()
A convenience method for at(WARNING).
Link copied to clipboard
protected String getName()
Returns the non-null name of this logger (Flogger does not currently support anonymous loggers).
Link copied to clipboard
protected final boolean isLoggable(Level level)
Returns whether the given level is enabled for this logger.