i want to write all Netduino Error / Crashes to the microSD-Card. My Problem is, when the Error file is too big, the netduzino runs out of memory.
How can i fix it or is there a better way?
Public Function Log_Error(ByVal NetduinoError As String) Dim filestream As New IO.FileStream("\SD\ERRORS\ERROR.log", IO.FileMode.Open) Dim Streamreader As New IO.StreamReader(filestream) Dim x As String = Streamreader.ReadToEnd Streamreader.Close() filestream.Close() x = x & vbcrlf & Date.Now & ": " & NetduinoError Dim filestream2 As New IO.FileStream("SD\ERRORS\ERROR.log", IO.FileMode.Append, IO.FileAccess.Write, IO.FileShare.None) Dim streamWriter As New IO.StreamWriter(filestream2) streamWriter.WriteLine(x) streamWriter.Close() filestream2.Close() Return NetduinoError End Function End Module
And a little Question more ^^. It dont understand "vbcrlf" (for a new line)
thx & mfg
gfc