General > Developers Corner

Quick question on file.Append

(1/1)

Zmaster:
I'm starting to create my own heavy logging system, but there's this one part I could never figure out

I'm starting simple (chat logs)
The logging part is working fine and all, but I can not for the life of me figure out how to put each new addition to the data file on a new line
I tried putting \n into the file.Append string but that wouldn't change what ended up in the code for whatever reason
This is how I'm editing the file right now
file.Append("chatlogs/"..curdate..".txt", newline.."\n")

Bytewave:

--- Quote from: Zmaster on March 23, 2015, 02:27:49 PM ---I'm starting to create my own heavy logging system, but there's this one part I could never figure out

I'm starting simple (chat logs)
The logging part is working fine and all, but I can not for the life of me figure out how to put each new addition to the data file on a new line
I tried putting \n into the file.Append string but that wouldn't change what ended up in the code for whatever reason
This is how I'm editing the file right now
file.Append("chatlogs/"..curdate..".txt", newline.."\n")

--- End quote ---
How are you viewing the file created by your script? Windows Notepad?
Either try a different text editor, or use \r\n as a new line escape sequence.

Zmaster:

--- Quote from: Bytewave on March 23, 2015, 02:30:05 PM ---How are you viewing the file created by your script? Windows Notepad?

--- End quote ---

Yep, that would be it
Just checked it in Notepad++ and it shows on different lines there
Now I have even more reason to never use Notepad
Thanks for the quick response, Bytewave

Navigation

[0] Message Index

Go to full version