Package com.couchbase.lite
Class FileLogger
- java.lang.Object
-
- com.couchbase.lite.FileLogger
-
- All Implemented Interfaces:
Logger
public final class FileLogger extends java.lang.Object implements Logger
A logger for writing to a file in the application's storage so that log messages can persist durably after the application has stopped or encountered a problem. Each log level is written to a separate file. Threading policy: This class is certain to be used from multiple threads. As long as it is thread safe, the various race conditions are unlikely and the penalties very small. "Volatile" ensures the thread safety and the several races are tolerable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogFileConfiguration
getConfig()
Gets the configuration currently in use by the file logger.LogLevel
getLevel()
Gets the level that will be logged via this logger.void
log(LogLevel level, LogDomain domain, java.lang.String message)
Performs the actual logging logicvoid
setConfig(LogFileConfiguration newConfig)
Sets the configuration for use by the file logger.void
setLevel(LogLevel level)
Sets the overall logging level that will be written to the logging files.
-
-
-
Method Detail
-
log
public void log(@NonNull LogLevel level, @NonNull LogDomain domain, @NonNull java.lang.String message)
Description copied from interface:Logger
Performs the actual logging logic
-
getLevel
@NonNull public LogLevel getLevel()
Description copied from interface:Logger
Gets the level that will be logged via this logger.
-
setLevel
public void setLevel(@NonNull LogLevel level)
Sets the overall logging level that will be written to the logging files.- Parameters:
level
- The maximum level to include in the logs
-
getConfig
@Nullable public LogFileConfiguration getConfig()
Gets the configuration currently in use by the file logger. Note that once a configuration has been installed in a logger, the configuration is read-only and can no longer be modified. An attempt to modify the configuration returned by this method will cause an exception.- Returns:
- The configuration currently in use
-
setConfig
public void setConfig(@Nullable LogFileConfiguration newConfig)
Sets the configuration for use by the file logger.- Parameters:
newConfig
- The configuration to use
-
-