File was renamed from im_lib/src/main/java/com/anyun/im_lib/util/MyLog.java |
| | |
| | | package com.anyun.im_lib.util; |
| | | package com.anyun.basecommonlib; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | public class MyLog { |
| | | |
| | | private static final String TAG = "AYJiaKao"; |
| | | private static final String TAG = "AYJiaKao"; |
| | | |
| | | |
| | | // 日志文件在sdcard中的路径 |
| | |
| | | |
| | | private static Boolean MYLOG_SWITCH = true; // 日志文件总开关 |
| | | |
| | | private static Boolean MYLOG_WRITE_TO_FILE = true;// 日志写入文件开关 |
| | | private static Boolean MYLOG_WRITE_TO_FILE = false;// 日志写入文件开关 |
| | | private static File file; |
| | | |
| | | // 输入日志类型,w代表只输出告警信息等,v代表输出所有信息 |
| | |
| | | * @param text |
| | | */ |
| | | static int count=0; |
| | | private static void writeLogtoFile( final String tag, final String text) {// 新建或打开日志文件 |
| | | private static synchronized void writeLogtoFile( final String tag, final String text) {// 新建或打开日志文件 |
| | | |
| | | String needWriteMessage = myLogSdf.format(System.currentTimeMillis()) + " " + tag + " " + text; |
| | | |
| | |
| | | File tempFile = null; |
| | | for (int j = 0; j < 5; j++) { |
| | | tempFile = new File(dirPath,PREFREIX+j+".txt"); |
| | | Log.i(TAG,"tempFIle Name= "+tempFile.getName()); |
| | | |
| | | if (tempFile.length()>20*1024*1024) { |
| | | if (j==4){ |
| | |
| | | |
| | | |
| | | }else{ |
| | | Log.i(TAG,String.format("返回文件%s",tempFile.getName())); |
| | | // Log.i(TAG,String.format("返回文件%s",tempFile.getName())); |
| | | break; |
| | | } |
| | | |