Class Slf4jStream
java.lang.Object
org.zeroturnaround.exec.stream.slf4j.Slf4jStream
Creates output streams that write to
Loggers.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasDebug()asError()asInfo()asTrace()asWarn()static Slf4jStreamstatic Slf4jStreamConstructs a logger from a class name and an additional name, appended to the end.static Slf4jStreamstatic Slf4jStreamof(org.slf4j.Logger log) static Slf4jStreamofCaller()
-
Field Details
-
log
private final org.slf4j.Logger log
-
-
Constructor Details
-
Slf4jStream
private Slf4jStream(org.slf4j.Logger log)
-
-
Method Details
-
of
- Parameters:
log- logger which an output stream redirects to.- Returns:
- Slf4jStream with the given logger.
-
of
- Parameters:
klass- class which is used to get the logger's name.- Returns:
- Slf4jStream with a logger named after the given class.
-
of
Constructs a logger from a class name and an additional name, appended to the end. So the final logger name will be:klass.getName() + "." + name- Parameters:
klass- class which is used to get the logger's name.name- logger's name, appended to the class name.- Returns:
- Slf4jStream with a logger named after the given class.
- Since:
- 1.8
-
of
- Parameters:
name- logger's name (full or short). In case of short name (no dots) the given name is prefixed by caller's class name and a dot.- Returns:
- Slf4jStream with the given logger.
-
ofCaller
- Returns:
- Slf4jStream with the logger of caller of this method.
-
as
- Parameters:
level- the desired logging level- Returns:
- output stream that writes with a given level.
-
asTrace
- Returns:
- output stream that writes
tracelevel.
-
asDebug
- Returns:
- output stream that writes
debuglevel.
-
asInfo
- Returns:
- output stream that writes
infolevel.
-
asWarn
- Returns:
- output stream that writes
warnlevel.
-
asError
- Returns:
- output stream that writes
errorlevel.
-