On 2018-05-04 13:30, Bart via Lazarus wrote: > On Fri, May 4, 2018 at 12:51 PM, Carlos E. R. via Lazarus > <lazarus@lists.lazarus-ide.org> wrote: > >> I want to do a series of "writeln(...)" and have the output go >> simultaneously to the console and to a text file of my choice. I have >> the vague idea that this was done writing a text file handler :-? > > I once wrote a simple utility (myutil) that read from stdin, echoed to > stdout and echoed to a logfile. > I then used a pipe from the commandline to achieve what I wanted. > E.g.: > > myprog | mytuil path/to/log > > Or something similar to that.
Yes, of course, that's what I'm doing now, but I wanted to do it internally, control the file name, perhaps rotate it, etc :-) Actually: myprog | tee mytuil path/to/log It has the effect that text to screen is written in chunks, may stop at the middle of a line. So at the end each cycle, I issue a "flush(output);" -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
signature.asc
Description: OpenPGP digital signature
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus