Package org.scijava.log
Interface LogService
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Logger,Prioritized,RichPlugin,SciJavaPlugin,SciJavaService,Service,Versioned
- All Known Implementing Classes:
AbstractLogService,StderrLogService
public interface LogService extends SciJavaService, Logger
Interface for the logging service.The service supports five common logging levels:
ERROR,WARN,INFO,TRACEandDEBUG. It is extensible to additional levels as needed. It provides methods for logging messages, exception stack traces and combinations of the two.- Author:
- Curtis Rueden, Matthias Arzt
-
-
Field Summary
Fields Modifier and Type Field Description static intDEBUGDeprecated.UseLogLevel.DEBUG.static intERRORDeprecated.UseLogLevel.ERROR.static intINFODeprecated.UseLogLevel.INFO.static StringLOG_LEVEL_BY_SOURCE_PROPERTYstatic StringLOG_LEVEL_PROPERTYSystem property to set for overriding the default logging level.static intNONEDeprecated.UseLogLevel.NONE.static intTRACEDeprecated.UseLogLevel.TRACE.static intWARNDeprecated.UseLogLevel.WARN.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsetLevel(int level)Changes the log level of the root logger.voidsetLevel(String classOrPackageName, int level)For messages that are logged directly to the LogService.voidsetLevelForLogger(String source, int level)Setting the log level for loggers depending on theirLogSource.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.log.Logger
addLogListener, alwaysLog, debug, debug, debug, error, error, error, getLevel, getName, getSource, info, info, info, isDebug, isError, isInfo, isLevel, isTrace, isWarn, log, log, log, notifyListeners, removeLogListener, subLogger, subLogger, trace, trace, trace, warn, warn, warn
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Field Detail
-
LOG_LEVEL_PROPERTY
static final String LOG_LEVEL_PROPERTY
System property to set for overriding the default logging level.- See Also:
- Constant Field Values
-
LOG_LEVEL_BY_SOURCE_PROPERTY
static final String LOG_LEVEL_BY_SOURCE_PROPERTY
- See Also:
- Constant Field Values
-
NONE
@Deprecated static final int NONE
Deprecated.UseLogLevel.NONE.- See Also:
- Constant Field Values
-
ERROR
@Deprecated static final int ERROR
Deprecated.UseLogLevel.ERROR.- See Also:
- Constant Field Values
-
WARN
@Deprecated static final int WARN
Deprecated.UseLogLevel.WARN.- See Also:
- Constant Field Values
-
INFO
@Deprecated static final int INFO
Deprecated.UseLogLevel.INFO.- See Also:
- Constant Field Values
-
DEBUG
@Deprecated static final int DEBUG
Deprecated.UseLogLevel.DEBUG.- See Also:
- Constant Field Values
-
TRACE
@Deprecated static final int TRACE
Deprecated.UseLogLevel.TRACE.- See Also:
- Constant Field Values
-
-
Method Detail
-
setLevel
void setLevel(int level)
Changes the log level of the root logger.
-
setLevel
void setLevel(String classOrPackageName, int level)
For messages that are logged directly to the LogService. The log level can be set depending on the class that makes the log.- Parameters:
classOrPackageName- If this is the name of a class. Messages logged directly by this class are logged, if the message's level is less or equal to the given level. If this is a package, the same holds for all classes in this package.level- Given level.
-
-