hello
I want to write my own log file, so i can manage it as I like
I need some suggestion to do "the right thing"
I will write several log rows every second, in append mode (parameter TRUE in File.OpenOutput
my log file will grow up to 1 meg, than i will copy to a .OLD file and open a new one
--- now the nice question
is it OK to re-initialize and re-open the file every time I write (append) something, or it's better to open it at the app start and keep it open?
if it's NOT time and resource consuming, I prefer to open and close every time I write
easy question, I think
thank you
I want to write my own log file, so i can manage it as I like
I need some suggestion to do "the right thing"
log:
Sub WriteLog(Message As String)
' log "standard", used by b4a ide
Log(Message)
' my own log file
Dim TextWriter1 As TextWriter
TextWriter1.Initialize(File.OpenOutput(File.DirRootExternal, "myLog.txt", True))
TextWriter1.WriteLine(Message)
TextWriter1.Close
End Sub
I will write several log rows every second, in append mode (parameter TRUE in File.OpenOutput
my log file will grow up to 1 meg, than i will copy to a .OLD file and open a new one
--- now the nice question
is it OK to re-initialize and re-open the file every time I write (append) something, or it's better to open it at the app start and keep it open?
if it's NOT time and resource consuming, I prefer to open and close every time I write
easy question, I think
thank you