public interface LogService extends SciJavaService, Logger
The service supports five common logging levels: ERROR
,
WARN
, INFO
, TRACE
and DEBUG
. It is
extensible to additional levels as needed. It provides methods for logging
messages, exception stack traces and combinations of the two.
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG
Deprecated.
Use
LogLevel.DEBUG . |
static int |
ERROR
Deprecated.
Use
LogLevel.ERROR . |
static int |
INFO
Deprecated.
Use
LogLevel.INFO . |
static String |
LOG_LEVEL_BY_SOURCE_PROPERTY |
static String |
LOG_LEVEL_PROPERTY
System property to set for overriding the default logging level.
|
static int |
NONE
Deprecated.
Use
LogLevel.NONE . |
static int |
TRACE
Deprecated.
Use
LogLevel.TRACE . |
static int |
WARN
Deprecated.
Use
LogLevel.WARN . |
Modifier and Type | Method and Description |
---|---|
void |
setLevel(int level)
Changes the log level of the root logger.
|
void |
setLevel(String classOrPackageName,
int level)
For messages that are logged directly to the LogService.
|
void |
setLevelForLogger(String source,
int level)
Setting the log level for loggers depending on their
LogSource . |
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
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
static final String LOG_LEVEL_PROPERTY
static final String LOG_LEVEL_BY_SOURCE_PROPERTY
@Deprecated static final int NONE
LogLevel.NONE
.@Deprecated static final int ERROR
LogLevel.ERROR
.@Deprecated static final int WARN
LogLevel.WARN
.@Deprecated static final int INFO
LogLevel.INFO
.@Deprecated static final int DEBUG
LogLevel.DEBUG
.@Deprecated static final int TRACE
LogLevel.TRACE
.void setLevel(int level)
void setLevel(String classOrPackageName, int level)
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.Copyright © 2015–2022 SciJava. All rights reserved.