rentaiming
2024-05-21 dd7ad1ab0ead2aa3c9f7fc35cc9b0635309c642a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.ruoyi.order.util.tencent.common;
 
import org.slf4j.Logger;
 
/**
 * User: rizenguo
 * Date: 2014/11/12
 * Time: 14:32
 */
public class Log {
 
    public static final String LOG_TYPE_TRACE = "logTypeTrace";
    public static final String LOG_TYPE_DEBUG = "logTypeDebug";
    public static final String LOG_TYPE_INFO = "logTypeInfo";
    public static final String LOG_TYPE_WARN = "logTypeWarn";
    public static final String LOG_TYPE_ERROR = "logTypeError";
 
    //打印日志
    private Logger logger;
 
    public Log(Logger log){
        logger = log;
    }
 
    public void t(String s){
        logger.trace(s);
    }
 
    public void d(String s){
        logger.debug(s);
    }
 
    public void i(String s){
        logger.info(s);
    }
 
    public void w(String s){
        logger.warn(s);
    }
 
    public void e(String s){
        logger.error(s);
    }
 
    public void log(String type,String s){
        if(type.equals(Log.LOG_TYPE_TRACE)){
            t(s);
        }else if(type.equals(Log.LOG_TYPE_DEBUG)){
            d(s);
        }else if(type.equals(Log.LOG_TYPE_INFO)){
            i(s);
        }else if(type.equals(Log.LOG_TYPE_WARN)){
            w(s);
        }else if(type.equals(Log.LOG_TYPE_ERROR)){
            e(s);
        }
    }
 
}