package com.elab.log.factory;

import com.dianping.cat.Cat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadFactory;

/**
 * @Module 工厂模块
 * @Description cat对应的处理工厂
 * @Author liukaixiong
 * @Date 2021/1/15 18:39
 */
public class CatThreadFactory extends CompletableFuture implements ThreadFactory {
    private Logger logger = LoggerFactory.getLogger(getClass());


    @Override
    public Thread newThread(Runnable r) {
        String currentMessageId = Cat.getCurrentMessageId();
        System.out.println("=====================" + currentMessageId);
        return new Thread(r);
    }



}
