package com.ibiz.util.log;

import com.alibaba.fastjson.JSON;

public class LogMessage {
    //方法开始
    public static final String Start = "【方法】启动。";
    public static final String Function_Start = "【方法】{}启动。";

    //方法正常结束
    public static final String End = "【方法】正常结束。";
    public static final String Function_End = "【方法】{}正常结束。";

    //方法入参
    public static final String Params = "【传入参数】：{}";

    //方法返回值
    public static final String ReturnedValue = "【返回值】:{}";

    //抛出检查异常
    public static final String ExceptionEnd = "【方法】准正常结束, 抛出了检查异常。";
    public static final String Function_ExceptionEnd = "【方法】{}准正常结束, 抛出了检查异常。";

    //抛出运行时异常
    public static final String ErrorEnd = "【方法】发生了异常，【异常信息】{}。";
    public static final String Function_ErrorEnd = "【方法】{}发生了异常，【异常信息】{}。";

    //抛出运行时异常对应的信息。
    public static final String ExceptionMsg = "【异常信息】:{}。";

    //耗时检查
    public static final String TimeCost = "【耗时】{}毫秒。";
    //当前时间戳
    public static final String CurrentTimeMillis = "【时间戳(毫秒)】{}";

    //循环
    public static final String For = "进入循环, for({})";
    public static final String While = "进入循环, while({})";

    //swich语句
    public static final String Switch = "进入switch，case({})";


    public static String getStr(Object params) {
        String paramStr = null;
        try {
            paramStr = JSON.toJSONString(params);
        } catch (Exception e) {
            paramStr = params + "";
        }
        return paramStr;
    }
}
