Class Slf4jLogger
- java.lang.Object
-
- org.sonar.api.utils.log.Slf4jLogger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Slf4jLogger(org.slf4j.Logger slf4jLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(java.lang.String msg)
Logs a DEBUG message.void
debug(java.lang.String msg, java.lang.Object arg)
Logs an DEBUG parameterized message according to the specified format and argument.void
debug(java.lang.String msg, java.lang.Object... args)
Logs an DEBUG parameterized message according to the specified format and arguments.void
debug(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Logs an DEBUG parameterized message according to the specified format and arguments.void
error(java.lang.String msg)
Logs an ERROR level message.void
error(java.lang.String msg, java.lang.Object arg)
Logs an ERROR parameterized message according to the specified format and argument.void
error(java.lang.String msg, java.lang.Object... args)
Logs a ERROR parameterized message according to the specified format and arguments.void
error(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Logs a ERROR parameterized message according to the specified format and arguments.void
error(java.lang.String msg, java.lang.Throwable thrown)
Logs an exception at the ERROR level with an accompanying message.LoggerLevel
getLevel()
void
info(java.lang.String msg)
Logs an INFO level message.void
info(java.lang.String msg, java.lang.Object arg)
Logs an INFO parameterized message according to the specified format and argument.void
info(java.lang.String msg, java.lang.Object... args)
Logs an INFO parameterized message according to the specified format and arguments.void
info(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Logs an INFO parameterized message according to the specified format and arguments.boolean
isDebugEnabled()
boolean
isTraceEnabled()
boolean
setLevel(LoggerLevel level)
Attempt to change logger level.void
trace(java.lang.String msg)
Logs a TRACE message.void
trace(java.lang.String msg, java.lang.Object arg)
Logs an TRACE parameterized message according to the specified format and argument.void
trace(java.lang.String msg, java.lang.Object... args)
Logs an TRACE parameterized message according to the specified format and arguments.void
trace(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Logs an TRACE parameterized message according to the specified format and arguments.void
warn(java.lang.String msg)
Logs a WARN level message.void
warn(java.lang.String msg, java.lang.Object arg)
Logs a WARN parameterized message according to the specified format and argument.void
warn(java.lang.String msg, java.lang.Object... args)
Logs a WARN parameterized message according to the specified format and arguments.void
warn(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Logs a WARN parameterized message according to the specified format and arguments.void
warn(java.lang.String msg, java.lang.Throwable thrown)
Logs an exception at the WARN level with an accompanying message.
-
-
-
Method Detail
-
isTraceEnabled
public boolean isTraceEnabled()
- Specified by:
isTraceEnabled
in interfaceLogger
-
trace
public void trace(java.lang.String msg)
Description copied from interface:Logger
Logs a TRACE message.TRACE messages must be valuable for diagnosing production problems. They must not be used for development debugging. They can significantly slow down performances. The standard use-case is logging of SQL and Elasticsearch requests.
-
trace
public void trace(java.lang.String msg, @Nullable java.lang.Object arg)
Description copied from interface:Logger
Logs an TRACE parameterized message according to the specified format and argument. Example:trace("Value is {}", value)
TRACE messages must be valuable for diagnosing production problems. They must not be used for development debugging. They can significantly slow down performances. The standard use-case is logging of SQL and Elasticsearch requests.
-
trace
public void trace(java.lang.String msg, @Nullable java.lang.Object arg1, @Nullable java.lang.Object arg2)
Description copied from interface:Logger
Logs an TRACE parameterized message according to the specified format and arguments. Example:trace("Values are {} and {}", value1, value2)
TRACE messages must be valuable for diagnosing production problems. They must not be used for development debugging. They can significantly slow down performances. The standard use-case is logging of SQL and Elasticsearch requests.
-
trace
public void trace(java.lang.String msg, java.lang.Object... args)
Description copied from interface:Logger
Logs an TRACE parameterized message according to the specified format and arguments. Example:trace("Values are {} and {}", value1, value2)
TRACE messages must be valuable for diagnosing production problems. They must not be used for development debugging. They can significantly slow down performances. The standard use-case is logging of SQL and Elasticsearch requests.
This variant incurs the hidden cost of creating an Object[] before invoking the method. The variants taking one and two arguments exist solely in order to avoid this hidden cost. See
Logger.trace(String, Object)
andLogger.trace(String, Object, Object)
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabled
in interfaceLogger
-
debug
public void debug(java.lang.String msg)
Description copied from interface:Logger
Logs a DEBUG message.DEBUG messages must be valuable for diagnosing production problems. They must not be used for development debugging.
-
debug
public void debug(java.lang.String msg, @Nullable java.lang.Object arg)
Description copied from interface:Logger
Logs an DEBUG parameterized message according to the specified format and argument. Example:debug("Value is {}", value)
Debug messages must be valuable for diagnosing production problems. They must not be used for development debugging.
-
debug
public void debug(java.lang.String msg, @Nullable java.lang.Object arg1, @Nullable java.lang.Object arg2)
Description copied from interface:Logger
Logs an DEBUG parameterized message according to the specified format and arguments. Example:debug("Values are {} and {}", value1, value2)
Debug messages must be valuable for diagnosing production problems. They must not be used for development debugging.
-
debug
public void debug(java.lang.String msg, java.lang.Object... args)
Description copied from interface:Logger
Logs an DEBUG parameterized message according to the specified format and arguments. Example:debug("Values are {}, {} and {}", value1, value2, value3)
Debug messages must be valuable for diagnosing production problems. They must not be used for development debugging. *
This variant incurs the hidden cost of creating an Object[] before invoking the method. The variants taking one and two arguments exist solely in order to avoid this hidden cost. See
Logger.debug(String, Object)
andLogger.debug(String, Object, Object)
-
info
public void info(java.lang.String msg)
Description copied from interface:Logger
Logs an INFO level message.
-
info
public void info(java.lang.String msg, @Nullable java.lang.Object arg)
Description copied from interface:Logger
Logs an INFO parameterized message according to the specified format and argument. Example:info("Value is {}", value)
-
info
public void info(java.lang.String msg, @Nullable java.lang.Object arg1, @Nullable java.lang.Object arg2)
Description copied from interface:Logger
Logs an INFO parameterized message according to the specified format and arguments. Example:info("Values are {} and {}", value1, value2)
-
info
public void info(java.lang.String msg, java.lang.Object... args)
Description copied from interface:Logger
Logs an INFO parameterized message according to the specified format and arguments. Example:info("Values are {}, {} and {}", value1, value2, value3)
This variant incurs the hidden cost of creating an Object[] before invoking the method. The variants taking one and two arguments exist solely in order to avoid this hidden cost. See
Logger.info(String, Object)
andLogger.info(String, Object, Object)
-
warn
public void warn(java.lang.String msg)
Description copied from interface:Logger
Logs a WARN level message.
-
warn
public void warn(java.lang.String msg, java.lang.Throwable thrown)
Description copied from interface:Logger
Logs an exception at the WARN level with an accompanying message.
-
warn
public void warn(java.lang.String msg, @Nullable java.lang.Object arg)
Description copied from interface:Logger
Logs a WARN parameterized message according to the specified format and argument. Example:warn("Value is {}", value)
-
warn
public void warn(java.lang.String msg, @Nullable java.lang.Object arg1, @Nullable java.lang.Object arg2)
Description copied from interface:Logger
Logs a WARN parameterized message according to the specified format and arguments. Example:warn("Values are {} and {}", value1, value2)
-
warn
public void warn(java.lang.String msg, java.lang.Object... args)
Description copied from interface:Logger
Logs a WARN parameterized message according to the specified format and arguments. Example:warn("Values are {}, {} and {}", value1, value2, value3)
This variant incurs the hidden cost of creating an Object[] before invoking the method. The variants taking one and two arguments exist solely in order to avoid this hidden cost. See
Logger.warn(String, Object)
andLogger.warn(String, Object, Object)
-
error
public void error(java.lang.String msg)
Description copied from interface:Logger
Logs an ERROR level message.
-
error
public void error(java.lang.String msg, @Nullable java.lang.Object arg)
Description copied from interface:Logger
Logs an ERROR parameterized message according to the specified format and argument. Example:error("Value is {}", value)
-
error
public void error(java.lang.String msg, @Nullable java.lang.Object arg1, @Nullable java.lang.Object arg2)
Description copied from interface:Logger
Logs a ERROR parameterized message according to the specified format and arguments. Example:error("Values are {} and {}", value1, value2)
-
error
public void error(java.lang.String msg, java.lang.Object... args)
Description copied from interface:Logger
Logs a ERROR parameterized message according to the specified format and arguments. Example:error("Values are {}, {} and {}", value1, value2, value3)
This variant incurs the hidden cost of creating an Object[] before invoking the method. The variants taking one and two arguments exist solely in order to avoid this hidden cost. See
Logger.error(String, Object)
andLogger.error(String, Object, Object)
-
error
public void error(java.lang.String msg, java.lang.Throwable thrown)
Description copied from interface:Logger
Logs an exception at the ERROR level with an accompanying message.
-
setLevel
public boolean setLevel(LoggerLevel level)
Description copied from interface:Logger
Attempt to change logger level. Return true if it succeeded, false if the underlying logging facility does not allow to change level at runtime.This method must not be used to enable DEBUG or TRACE logs in tests. Use
org.sonar.api.utils.log.LogTester.setLevel(LoggerLevel)
from the test-fixtures instead.The standard use-case is to customize logging of embedded 3rd-party libraries.
-
getLevel
public LoggerLevel getLevel()
-
-