Package org.apache.logging.log4j.message
Class DefaultFlowMessageFactory
java.lang.Object
org.apache.logging.log4j.message.DefaultFlowMessageFactory
- All Implemented Interfaces:
Serializable
,FlowMessageFactory
Default factory for flow messages.
- Since:
- 2.6
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs a message factory with"Enter"
and"Exit"
as the default flow strings.DefaultFlowMessageFactory
(String entryText, String exitText) Constructs a message factory with the given entry and exit strings. -
Method Summary
Modifier and TypeMethodDescriptionGets the entry text.Gets the exit text.newEntryMessage
(String format, Object... params) Creates a new entry message based on a format string with parameters.newEntryMessage
(Message message) Creates a new entry message based on an existing message.newExitMessage
(Object result, EntryMessage message) Creates a new exit message based on a return value and an existing entry message.newExitMessage
(Object result, Message message) Creates a new exit message based on a return value and an existing message.newExitMessage
(String format, Object result) Creates a new exit message based on a return value and a forma string.newExitMessage
(EntryMessage message) Creates a new exit message based on no return value and an existing entry message.newExitMessage
(Message message) Creates a new exit message based on no return value and an existing message.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultFlowMessageFactory
public DefaultFlowMessageFactory()Constructs a message factory with"Enter"
and"Exit"
as the default flow strings. -
DefaultFlowMessageFactory
Constructs a message factory with the given entry and exit strings.- Parameters:
entryText
- the text to use for trace entry, like"Enter"
.exitText
- the text to use for trace exit, like"Exit"
.
-
-
Method Details
-
getEntryText
Gets the entry text.- Returns:
- the entry text.
-
getExitText
Gets the exit text.- Returns:
- the exit text.
-
newEntryMessage
Description copied from interface:FlowMessageFactory
Creates a new entry message based on a format string with parameters.- Specified by:
newEntryMessage
in interfaceFlowMessageFactory
- Parameters:
format
- format stringparams
- parameters- Returns:
- the new entry message
-
newEntryMessage
Description copied from interface:FlowMessageFactory
Creates a new entry message based on an existing message.- Specified by:
newEntryMessage
in interfaceFlowMessageFactory
- Parameters:
message
- the original message- Returns:
- the new entry message
-
newExitMessage
Description copied from interface:FlowMessageFactory
Creates a new exit message based on a return value and a forma string.- Specified by:
newExitMessage
in interfaceFlowMessageFactory
- Parameters:
format
- a format stringresult
- the return value- Returns:
- the new exit message
-
newExitMessage
Description copied from interface:FlowMessageFactory
Creates a new exit message based on no return value and an existing message.- Specified by:
newExitMessage
in interfaceFlowMessageFactory
- Parameters:
message
- the original entry message- Returns:
- the new exit message
-
newExitMessage
Description copied from interface:FlowMessageFactory
Creates a new exit message based on no return value and an existing entry message.- Specified by:
newExitMessage
in interfaceFlowMessageFactory
- Parameters:
message
- the original entry message- Returns:
- the new exit message
-
newExitMessage
Description copied from interface:FlowMessageFactory
Creates a new exit message based on a return value and an existing entry message.- Specified by:
newExitMessage
in interfaceFlowMessageFactory
- Parameters:
result
- the return value.message
- the original entry message- Returns:
- the new exit message
-
newExitMessage
Description copied from interface:FlowMessageFactory
Creates a new exit message based on a return value and an existing message.- Specified by:
newExitMessage
in interfaceFlowMessageFactory
- Parameters:
result
- the return value.message
- the original message- Returns:
- the new exit message
-