Capturing print command output [message #63624] |
Mon, 17 November 2008 05:28  |
Nicolas
Messages: 15 Registered: September 2007
|
Junior Member |
|
|
Hi folks,
I have an interesting problem for you to solve! :)
What I am trying to do is to capture the expressions output by a
routine containing IDL 'print' commands.
Of course without modifing the code of this routine (no 'printf').
I have though about the following solutions:
1- Make a wrapper of the routine that what to execute
2- Make a sort of 'buffer listener' that can restore its content on
demand
3- Temporarily redirect the standard output of the 'print' command
None of them seems to be conclusive. Do you have any other ideas?
Cheers,
Nicolas
|
|
|
Re: Capturing print command output [message #63724 is a reply to message #63624] |
Mon, 17 November 2008 21:27  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Nov 17, 8:28 am, Nicolas <primese...@gmail.com> wrote:
> Hi folks,
>
> I have an interesting problem for you to solve! :)
>
> What I am trying to do is to capture the expressions output by a
> routine containing IDL 'print' commands.
> Of course without modifing the code of this routine (no 'printf').
>
> I have though about the following solutions:
> 1- Make a wrapper of the routine that what to execute
> 2- Make a sort of 'buffer listener' that can restore its content on
> demand
> 3- Temporarily redirect the standard output of the 'print' command
>
> None of them seems to be conclusive. Do you have any other ideas?
If you go for the 'wrapper' approach, you might consider PRINTLOG,
which is a drop-in replacement for PRINT, with logging.
Craig
PRINTLOG found here:
http://cow.physics.wisc.edu/~craigm/idl/io.html
|
|
|
Re: Capturing print command output [message #63746 is a reply to message #63624] |
Mon, 17 November 2008 09:58  |
Abraham campbell
Messages: 10 Registered: January 2008
|
Junior Member |
|
|
On Nov 17, 9:14 am, Paolo <pgri...@gmail.com> wrote:
> Nicolas wrote:
>> On Nov 17, 3:52 pm, Brian Larsen <balar...@gmail.com> wrote:
>>> This certainly doesn't meet all of your requirements but journal might
>>> meet some (enough) of your needs with zero effort?
>
>>> Cheers,
>
>>> Brian
>
>>> ------------------------------------------------------------ --------------
>>> Brian Larsen
>>> Boston University
>>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
>> Indeed but I could be a nice workaround.
>> I realized that what I need is actually a pipe for redirecting IDL
>> routine/function standard output
>
> On UNIX like system you can certainly do
> idl > log.txt
> and variations thereof.
> Ciao,
> Paolo
>
>
>
>> Anyway, thank you very much!
You can also redirect IDL output with the Windows Command line app,
e.g.
> idl.exe > idl.out
|
|
|
Re: Capturing print command output [message #63753 is a reply to message #63624] |
Mon, 17 November 2008 08:14  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
Nicolas wrote:
> On Nov 17, 3:52�pm, Brian Larsen <balar...@gmail.com> wrote:
>> This certainly doesn't meet all of your requirements but journal might
>> meet some (enough) of your needs with zero effort?
>>
>> Cheers,
>>
>> Brian
>>
>> ------------------------------------------------------------ --------------
>> Brian Larsen
>> Boston University
>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
> Indeed but I could be a nice workaround.
> I realized that what I need is actually a pipe for redirecting IDL
> routine/function standard output
On UNIX like system you can certainly do
idl > log.txt
and variations thereof.
Ciao,
Paolo
>
> Anyway, thank you very much!
|
|
|