| | |
| | | package com.hdl.photovoltaic.other; |
| | | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.utils.TimeUtils; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class HdlLogLogic { |
| | | |
| | | //是否需要打印到Logcat上(true不需要打印) |
| | | public static boolean isPrintLogcat = false; |
| | | //默认打印标题 |
| | | private static final String title = "自定义输出打印信息:"; |
| | | //是否需要打印到Logcat上(false不需要打印) |
| | | public static boolean isPrintLogcat = true; |
| | | |
| | | //默认打印标题 |
| | | private static String logTitle = "自定义输出打印信息"; |
| | | |
| | | /** |
| | | * java打印 |
| | |
| | | * @param isAddToMemory 是否加入内存(本地日志用到) |
| | | */ |
| | | private static void printBase(String msg, String code, boolean isAddToMemory) { |
| | | if (isPrintLogcat) { |
| | | return; |
| | | } |
| | | CustomLogObject customLogObject = new CustomLogObject(); |
| | | customLogObject.msgOrData = msg; |
| | | customLogObject.code = code; |
| | | String json = title; |
| | | String json = logTitle + (UserConfigManage.getInstance().isBAccount() ? "(B端):" : "(C端):"); |
| | | json += customLogObject.getJointMessage(); |
| | | System.out.println(json); |
| | | if (isPrintLogcat) { |
| | | System.out.println(json); |
| | | } |
| | | if (isAddToMemory) { |
| | | writeLog(customLogObject.getJointMessage()); |
| | | } |