mirror of https://github.com/longtai-cn/hippo4j
parent
b36e17920e
commit
5279d6209c
@ -1,32 +0,0 @@
|
|||||||
package cn.hippo4j.common.notify;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Task trace decorator.
|
|
||||||
*
|
|
||||||
* @author chen.ma
|
|
||||||
* @date 2022/3/2 19:45
|
|
||||||
*/
|
|
||||||
public interface TaskTraceBuilder {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Before.
|
|
||||||
*/
|
|
||||||
default void before() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trace build.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String traceBuild();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear.
|
|
||||||
*/
|
|
||||||
default void clear() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,25 @@
|
|||||||
|
package cn.hippo4j.common.toolkit;
|
||||||
|
|
||||||
|
import org.slf4j.MDC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MD util.
|
||||||
|
*
|
||||||
|
* @author chen.ma
|
||||||
|
* @date 2022/3/3 08:30
|
||||||
|
*/
|
||||||
|
public class MDCUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get and remove.
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getAndRemove(String key) {
|
||||||
|
String val = MDC.get(key);
|
||||||
|
MDC.remove(key);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue