監聽Log 並寫入檔案

2021-06-06 23:26:53 字數 704 閱讀 6660

public class notelog 

public static void stopnotelog()

}private static void startnotelogthread() catch (ioexception e) finally }};

readlogthread.start();

}private static void readlogcatinfo() throws ioexception

}private static void write(string data)

file logfile = new file(log_path);

if (logfile.exists())

}out = new fileoutputstream(log_path, true);

if (data != null && !data.contains("beginning"))

} catch (ioexception e) finally catch (ioexception e) }}

}private static void closelogreader()

if (reader != null)

} catch (ioexception e)

}}

在manifest.xml中增加許可權

log檔案的讀並寫入 text檔案

今天要寫乙個功能的 讀.log檔案並去相關字段寫入.txt 在此做個筆記!public const string readfilepath c documents and settings admin 桌面access 20111207.log public const string writefi...

如何控制工程中的LOG資訊,並寫入檔案

02 tflog.h 03 04 created by tom fewster on 08 06 2010.05 06 07 if target os iphone target iphone simulator 08 import 09 else 10 import 11 endif 12 13 ...

解析檔案並寫入檔案裡

ifndef analys h define analys h include include object.h define fgetsmax 6 1024 1024 獲取一行資料的最大值6m class object class analys object char v,int l value ...