public class DeprecationLogger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
WARNING_HEADER
The "Warning" Header comes from RFC-7234.
|
Constructor and Description |
---|
DeprecationLogger(org.apache.logging.log4j.Logger parentLogger)
Creates a new deprecation logger based on the parent logger.
|
Modifier and Type | Method and Description |
---|---|
void |
deprecated(java.lang.String msg,
java.lang.Object... params)
Logs a deprecated message.
|
static void |
removeThreadContext(ThreadContext threadContext)
Remove the
ThreadContext used to add deprecation headers to network responses. |
static void |
setThreadContext(ThreadContext threadContext)
Set the
ThreadContext used to add deprecation headers to network responses. |
public static final java.lang.String WARNING_HEADER
public DeprecationLogger(org.apache.logging.log4j.Logger parentLogger)
public static void setThreadContext(ThreadContext threadContext)
ThreadContext
used to add deprecation headers to network responses.
This is expected to only be invoked by the Node
's constructor (therefore once outside of tests).
threadContext
- The thread context owned by the ThreadPool
(and implicitly a Node
)java.lang.IllegalStateException
- if this threadContext
has already been setpublic static void removeThreadContext(ThreadContext threadContext)
ThreadContext
used to add deprecation headers to network responses.
This is expected to only be invoked by the Node
's close
method (therefore once outside of tests).
threadContext
- The thread context owned by the ThreadPool
(and implicitly a Node
)java.lang.IllegalStateException
- if this threadContext
is unknown (and presumably already unset before)public void deprecated(java.lang.String msg, java.lang.Object... params)