Code example for FileWriter

Methods: append, close, flush

0
			 
		}// end of "if true, do all this" 
		else { 
			// request for logging to be shut off. Try and close the file gracefully and set log handle to null. 
			try { 
				mLogFile.flush();
				mLogFile.close();
				mLogFile = null;
			} catch (Exception e) {
				msg ("Error while closing logfile: " + e.getMessage());
			} 
		} 
 
		return true; 
	} 
 
	public boolean appendLog (String dataLine) {
		if (mLogFile == null) {
			if (DEBUG) msg ("Error appending to logfile: file handle is null");
			return false; 
		} 
		 
		try { 
			mLogFile.append(dataLine);
		} catch (Exception e) {
			// kill it.  
			msg ("Error writing to log so we will now terminate logging. Error was: " + e.getMessage());
			setLogging(false); 
			return false;