Class AbstractBackend
- java.lang.Object
-
- com.google.common.flogger.backend.LoggerBackend
-
- com.google.common.flogger.backend.system.AbstractBackend
-
- Direct Known Subclasses:
SimpleLoggerBackend
public abstract class AbstractBackend extends com.google.common.flogger.backend.LoggerBackendCommon backend to handle everything except formatting of log message and metadata. This is an unstable implementation and should not be used outside of the Flogger core library.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBackend(java.lang.String loggingClass)Constructs an abstract backend for the given class name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetLoggerName()booleanisLoggable(java.util.logging.Level lvl)voidlog(java.util.logging.LogRecord record, boolean wasForced)Logs the given record using this backend.
-
-
-
Constructor Detail
-
AbstractBackend
protected AbstractBackend(java.lang.String loggingClass)
Constructs an abstract backend for the given class name.Nested or inner class names (containing
$are converted to names matching the standard JDK logger namespace by converting '$' to '.', but in future it is expected that nested and inner classes (especially anonymous ones) will have their names truncated to just the outer class name. There is no benefit to having loggers named after an inner/nested classes, and this distinction is expected to go away.
-
-
Method Detail
-
getLoggerName
public final java.lang.String getLoggerName()
- Specified by:
getLoggerNamein classcom.google.common.flogger.backend.LoggerBackend
-
isLoggable
public final boolean isLoggable(java.util.logging.Level lvl)
- Specified by:
isLoggablein classcom.google.common.flogger.backend.LoggerBackend
-
log
public final void log(java.util.logging.LogRecord record, boolean wasForced)Logs the given record using this backend. IfwasForcedis set, the backend will make a best effort attempt to bypass any log level restrictions in the underlying JavaLogger, but there are circumstances in which this can fail.
-
-