How to save information in log file

Dear All,
How can I save all my cout statement in log/txt file in root ?

Thanks in Advance.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

You can do (in the ROOT prompt)

root [0] .> mylog.txt
.x mymacro.C
root [1]

basically, putting between “.>” the commands you want to run. But this saves in the txt file more than just the cout output, so if you only want to save the “couts”, it’s better to export the output directly from your within code, using ofstream for instance, instead of cout.

Thanks for your reply.

What I want is that what I have to write in the macro than doing it from outside.
And another thing is that I want to save the entry in a .txt file so that I can use it later for some other purposes(say drawing TGraph).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.