public class DefaultLogBuilder extends Object implements LogBuilder
NOOP
Constructor and Description |
---|
DefaultLogBuilder(Logger logger) |
DefaultLogBuilder(Logger logger,
Level level) |
Modifier and Type | Method and Description |
---|---|
boolean |
isInUse() |
void |
log()
Causes all the data collected to be logged.
|
void |
log(CharSequence message)
Causes all the data collected to be logged along with the message.
|
void |
log(Message message)
Causes all the data collected to be logged along with the message.
|
void |
log(Object message)
Causes all the data collected to be logged along with the message.
|
void |
log(String message)
Causes all the data collected to be logged along with the message.
|
void |
log(String message,
Object... params)
Logs a message with parameters.
|
void |
log(String message,
Object p0)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8)
Logs a message with parameters.
|
void |
log(String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8,
Object p9)
Logs a message with parameters.
|
void |
log(String message,
Supplier<?>... params)
Causes all the data collected to be logged along with the message and parameters.
|
void |
log(Supplier<Message> messageSupplier)
Causes all the data collected to be logged along with the message.
|
LogBuilder |
reset(Level level)
This method should be considered internal.
|
LogBuilder |
withLocation()
An implementation will calculate the caller's stack frame and include it in the log event.
|
LogBuilder |
withLocation(StackTraceElement location)
Adds the specified stack trace element to the log event.
|
LogBuilder |
withMarker(Marker marker)
Includes a Marker in the log event.
|
LogBuilder |
withThrowable(Throwable throwable)
Includes a Throwable in the log event.
|
public DefaultLogBuilder(Logger logger)
public LogBuilder reset(Level level)
level
- The logging level for this event.public LogBuilder withMarker(Marker marker)
LogBuilder
withMarker
in interface LogBuilder
marker
- The Marker to log.public LogBuilder withThrowable(Throwable throwable)
LogBuilder
withThrowable
in interface LogBuilder
throwable
- The Throwable to log.public LogBuilder withLocation()
LogBuilder
withLocation
in interface LogBuilder
public LogBuilder withLocation(StackTraceElement location)
LogBuilder
withLocation
in interface LogBuilder
location
- The stack trace element to include in the log event.public boolean isInUse()
public void log(Message message)
LogBuilder
log
in interface LogBuilder
message
- The message to log.public void log(CharSequence message)
LogBuilder
log
in interface LogBuilder
message
- The message to log.public void log(String message)
LogBuilder
log
in interface LogBuilder
message
- The message to log.public void log(String message, Object... params)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.params
- parameters to the message.Unbox
public void log(String message, Supplier<?>... params)
LogBuilder
log
in interface LogBuilder
message
- The message.params
- Parameters to the message.public void log(Supplier<Message> messageSupplier)
LogBuilder
log
in interface LogBuilder
messageSupplier
- The supplier of the message to log.public void log(Object message)
LogBuilder
log
in interface LogBuilder
message
- The message to log.public void log(String message, Object p0)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.p8
- parameter to the message.Unbox
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9)
LogBuilder
log
in interface LogBuilder
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.p8
- parameter to the message.p9
- parameter to the message.Unbox
public void log()
LogBuilder
log
in interface LogBuilder
Copyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.