Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write the msg in debug file on the sdCard
- * @param msg Msg written in debug file
- */
- private static void logInDebugFile(String msg)
- {
- FileOutputStream mFileOutputStream = null;
- OutputStreamWriter mOutputStreamWriter = null;
- /*FileInputStream mFileInputStream = null;
- InputStreamReader mInputStreamReader = null;
- String Flag = "----|***NOW***|----";*/
- try{
- //File myFile = new File("/sdcard/filharmonie_debug.log");
- //long sizeDebugFile = myFile.length();
- mFileOutputStream = new FileOutputStream("/sdcard/filharmonie_debug.log", true);
- mOutputStreamWriter = new OutputStreamWriter(mFileOutputStream);
- //Taille du fichier limité à 3Mo (environ: à plus ou moins 1 log)
- //if( sizeDebugFile < 3072 ) {
- msg = convertDateTimeToStringForLog(new Date())+ " --- " + msg + "\n";
- mOutputStreamWriter.write(msg);
- mOutputStreamWriter.flush();
- /*}
- else {
- msg = convertDateTimeToStringForLog(new Date())+ " --- " + msg + "\n";
- mInputStreamReader = new InputStreamReader(mFileInputStream);
- mInputStreamReader.
- mOutputStreamWriter.w
- mOutputStreamWriter.write(msg);
- mOutputStreamWriter.flush();
- }*/
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- finally {
- try {
- mOutputStreamWriter.close();
- mFileOutputStream.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement