Question

Logging to a log file -new line problem

  • 16 August 2019
  • 2 replies
  • 3 views

I use the below items

* Use an attributeFileWriter

* Use a dynamic string built up eg -----------------------------------2019-08-14 15:18->Roads in gdb:37574----------------------------------------------------------------------2019-08-14 15:18->Roads in gdb with duplicate removed:37572----------------------------------------------------------------------2019-08-14 15:18->Roads in SDE::37474----------------------------------------------------------------------2019-08-14 15:18->Roads in SDE with duplicate removed:37454-----------------------------------

* I log into a txt file

* After every ----------------------------------- I have a new line inserted

 

Problem-

* When I open the text file, why don't I see the line feeds as I inserted them

 

Cofusion-

* when I copy/paste the contend into a rich editor eg browser, Word I can see the line feeds


2 replies

Userlevel 5
Badge +25

It may depend on encoding, your operating system and which text editor you use to check it.

What works for me (on a Mac) is using an AttributeManager to add a newline at the end of the attribute before writing it to the log file with the AttributeFileWriter.

I get it correctly in "Notepad++" but not in "Notepad"

I believe the answer is in the encoding, "System.default" is what I set

 

 

Reply