Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#10 Change default newline for FileLogger

open
nobody
None
5
2005-09-08
2005-09-08
Anonymous
No

Hi,

I noticed that the default newline for FileLogger is set to "\n".
This would be fine, except on Windows, stack traces use "\r\n" in them.
So when I look at my log file (at least in GVim) I see "^M" characters on the stack traces (it detects the file as Unix format, so the editor treats _all_ line endings as such and prints the carriage returns because they don't belong).

Point is, you can get the default system newline character from the System.Environment.NewLine property. So why not use that instead of setting the newline character to "\n"? It saves a line of user code when the newline is different on their system.

Thanks. This is a great tool.

-Tom

Discussion