老子的换行呢。。。
尝试
```javascript
/**
* Filename: LoggerSaveManager.java
* Description:
* Copyright: Copyright (c)2015
* Company: SENRSL
* @author: senRsl senRsl@163.com
* @version: 1.0
* Create at: 2015年7月28日 下午4:17:11
*
* Modification History:
* Date Author Version Description
* ------------------------------------------------------------------
* 2015年7月28日 senRsl 1.0 1.0 Version
*/
package dc.common.log;
import java.util.HashMap;
import java.util.Map;
import android.content.Context;
/**
*
* @author senrsl
*
*/
public class LoggerSaveManager {
private static Map<String,LoggerSave> map = new HashMap<String, LoggerSave>();
protected static boolean isSave = false;
public static LoggerSave get(){
return get(null);
}
public static LoggerSave get(String name){
if(null == name || "".equals(name))return map.get(0);
return map.get(name);
}
public static int start(Context ctx){
isSave = true;
return create(ctx);
}
public static int start(Context ctx,String logPath,String logName){
isSave = true;
return create(ctx, logPath, logName);
}
public static int create(Context ctx){
return create(ctx, null, null);
}
public static int create(Context ctx,String logPath,String logName){
if(map.containsKey(logName))return map.size();
LoggerSave ls = new LoggerSave(ctx, logPath, logName);
map.put(logName, ls);
return map.size();
}
public static void save(String str){
save(null, str);
}
public static void save(String name,String str){
try {
map.get(name).save(str);
} catch (Exception e) {
e.printStackTrace();
}
}
private static LoggerSaveCat lsc;
public static void startCat(Context ctx){
startCat(ctx, null, null);
}
public static void startCat(Context ctx,String logPath,String logName){
try {
if(null == lsc)lsc = new LoggerSaveCat(ctx, logPath, logName);
lsc.start();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void stopCat(){
if(null != lsc)lsc.stop();
}
}
```
转换:
把换行转没了。。。。。也没加个pre什么的。。。。
/** * Filename: LoggerSaveManager.java * Description: * Copyright: Copyright (c)2015 * Company: SENRSL * @author: senRsl senRsl@163.com * @version: 1.0 * Create at: 2015年7月28日 下午4:17:11 * * Modification History: * Date Author Version Description * ------------------------------------------------------------------ * 2015年7月28日 senRsl 1.0 1.0 Version */ package dc.common.log; import java.util.HashMap; import java.util.Map; import android.content.Context; /** * * @author senrsl * */ public class LoggerSaveManager { private static Map<String,LoggerSave> map = new HashMap<String, LoggerSave>(); protected static boolean isSave = false; public static LoggerSave get(){ return get(null); } public static LoggerSave get(String name){ if(null == name || "".equals(name))return map.get(0); return map.get(name); } public static int start(Context ctx){ isSave = true; return create(ctx); } public static int start(Context ctx,String logPath,String logName){ isSave = true; return create(ctx, logPath, logName); } public static int create(Context ctx){ return create(ctx, null, null); } public static int create(Context ctx,String logPath,String logName){ if(map.containsKey(logName))return map.size(); LoggerSave ls = new LoggerSave(ctx, logPath, logName); map.put(logName, ls); return map.size(); } public static void save(String str){ save(null, str); } public static void save(String name,String str){ try { map.get(name).save(str); } catch (Exception e) { e.printStackTrace(); } } private static LoggerSaveCat lsc; public static void startCat(Context ctx){ startCat(ctx, null, null); } public static void startCat(Context ctx,String logPath,String logName){ try { if(null == lsc)lsc = new LoggerSaveCat(ctx, logPath, logName); lsc.start(); } catch (Exception e) { e.printStackTrace(); } } public static void stopCat(){ if(null != lsc)lsc.stop(); } }
--
senRsl
2016年06月29日12:16:29
2016年06月29日12:16:29
没有评论 :
发表评论