what is the best Way to save the Debug Log in File, if the user it switch on (i will it enabel/disable with a switch)?
my idea is to call a sub instead of Log(...)
Is this the best way or is there a better way?
my idea is to call a sub instead of Log(...)
B4X:
Sub WriteLogToFile(txt As String)
Log(txt)
Dim txtWriter As TextWriter
txtWriter.Initialize(File.OpenOutput(File.DirData("MyApp"),"Logfile.txt",True))
txtWriter.WriteLine(txt)
txtWriter.Close
End Sub
Is this the best way or is there a better way?