#1 2018-10-18 22:08:10

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,547
Website

CR is a wrong end-of-line character for Unix (at last for logs)

We have a very Unix- unfriendly end-of-line character in many place of framework. All modern Unix use LF (0A) for new line, but TTextWriter adds CR in case twoEndOfLineCRLF is not included in Options.

My BIG pain is logs files produced by TSynLog -  many unix tools expect LF as end-of-line (all unix logs in /var/log for example use LF).

My propose is to change line separator from CR to LF in case EndOfLineCRLF is false (in fact inside TTextWriter.AddEndOfLine).  Thank to good implementation of TSynLog it will work without problem in this case.

Also there is a bug in TTextWriter.SetEndOfLineCRLF - in case False is passed there we should call Exclude.

Online

#2 2018-10-19 07:27:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,258
Website

Re: CR is a wrong end-of-line character for Unix (at last for logs)

Offline

#3 2018-10-19 11:32:55

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,547
Website

Re: CR is a wrong end-of-line character for Unix (at last for logs)

Perfect! Thanks. As far all works as expected.

BTW I replaced my desktop operating system with Ubuntu18 from Win10 - very-very positive experience. Everything work much faster. I'm surprised how much better Lazarus debugger works under Linux smile

Online

#4 2018-10-19 20:28:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,258
Website

Re: CR is a wrong end-of-line character for Unix (at last for logs)

smile

Offline

#5 2018-10-20 04:50:58

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: CR is a wrong end-of-line character for Unix (at last for logs)

mpv wrote:

Everything work much faster. I'm surprised how much better Lazarus debugger works under Linux smile

Would love to hear some first-hand details smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB