Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-11

Capture HeadTrace output to file?

11 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when I quite the application to a file?

I tried the normal: $./text > out.log

But that doesn't work... the out.log is empty.

Regards,
- Graeme -

Marco van de Voort
to Graeme Geldenhuys

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 9 lines
Hi, If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when I quite the application to a file? I tried the normal: $./text > out.log But that doesn't work... the out.log is empty.

./something >& out.log

however units like crt might make this not possible. The exact solution for that differs with application.

Vincent Snijders
to Graeme Geldenhuys: If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when…
Graeme Geldenhuys wrote 9 lines
Hi, If I compile a project the -gh (Heaptrc unit), how to I capture the output generated when I quite the application to a file? I tried the normal: $./text > out.log But that doesn't work... the out.log is empty.

RTFM for the log=... use
http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html

if no filename is given, it outputs to stderr and not stdout.

Vincent

Unknown author
to Marco van de Voort: [ Charset ISO-8859-1 unsupported, converting... ] ./something >& out.log however units…
Show quoted text 16 lines
[ Charset ISO-8859-1 unsupported, converting... ] > Hi, > > If I compile a project the -gh (Heaptrc unit), how to I capture the > output generated when I quite the application to a file? > > > I tried the normal: $./text > out.log > > But that doesn't work... the out.log is empty. ./something >& out.log however units like crt might make this not possible. The exact solution for that differs with application.

You can also set an environment variable.

http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html

Darius

Graeme Geldenhuys
to Vincent Snijders: RTFM for the log=... use http://www.freepascal.org/docs-html/rtl/heaptrc/environment.html…
Vincent Snijders wrote

Thanks Darius and Vincent. I'm new to heaptrc and just tried it out. For some reason I didn't even think to look for docs... My bad.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Marc Santhoff
to Graeme Geldenhuys: That didn't work... - Graeme - _______________________________________________ fpGUI - a…
Graeme Geldenhuys wrote 6 lines
On 30/11/2007, Marco van de Voort wrote: > > ./something >& out.log > That didn't work...

Maybe you use another shell than Marco (that's [t]csh), you could look at the man page for your in the part "output redirection" or similar.

For sh and maybe bash getting stdout and stderr in the file

./something 2>&1 out.log

should do. I didnt test, but getting stderr only may work like this:

./something 2> out.log

HTH,
Marc

Graeme Geldenhuys
to Marc Santhoff: Maybe you use another shell than Marco (that's [t]csh), you could look at the man page…
Marc Santhoff wrote 5 lines
For sh and maybe bash getting stdout and stderr in the file ./something 2>&1 out.log should do. I didnt test, but getting stderr only may work like this:

I use bash and the above doesn't work... Henry's example of ./something > log.txt 2>&1 works though.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Marc Santhoff
to Marc Santhoff: Maybe you use another shell than Marco (that's [t]csh), you could look at the man page…
Marc Santhoff wrote 14 lines
Am Freitag, den 30.11.2007, 13:45 +0200 schrieb Graeme Geldenhuys: > On 30/11/2007, Marco van de Voort wrote: > > > > ./something >& out.log > > > > That didn't work... Maybe you use another shell than Marco (that's [t]csh), you could look at the man page for your in the part "output redirection" or similar. For sh and maybe bash getting stdout and stderr in the file ./something 2>&1 out.log

That doesn't work, it would only for piping:

./stdfile 2>&1 | cat > out.log

But the rest was okay. Henry got it right however ...

Marc