comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Suppress print statement from nested procedures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Suppress print statement from nested procedures [message #90963 is a reply to message #86507] Tue, 19 May 2015 06:36 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/19/15 7:16 AM, rryan.asu@gmail.com wrote:
> At risk of waking the dead... I wanted to do this same thing. I did this....
>
> openw,lun,'/dev/null',/get_lun
>
> and all the print statements become
>
> printf,lun,'my message'
>
> and I can simply change the value of lun to direct the output to a file, stdout, stderr.
>
> -russell
>
>
> On Thursday, November 14, 2013 at 6:24:37 PM UTC-5, Sam wrote:
>> Hello all,
>>
>> I built a wrapper for a procedure (it calls many others, in turn),
>> but the output that was important for the original program is no
>> long important. In fact it's quite a nuisance. I'd rather not dig
>> down into the subroutines to add the option to turn off printing --
>> this would be a major effort. Is there an IDL equivalent of
>> redirecting to /dev/null (or a text file) when calling a procedure
>> from within another procedure? In a perfect world, it would be:
>>
>> pro wrapper
>> [snip]
>> while i lt 1000 do begin
>> [snip]
>> main_procedure >& /dev/null
>> [snip]
>> i++
>> endwhile
>> [snip]
>> end
>>
>>
>> Thanks!
>>
>> Sam

It won't necessarily help your current issue, but this is why I created
MG_LOG. It lets you configure your output to send it to a screen, change
it format (maybe add a add date/time stamp or routine the MG_LOG
statement was called from), or turn output on/off by levels from
CRITICAL to DEBUG.

Check out a recent post of my site for some more information (before it
goes off into the weeds about a specific issue on subloggers):


http://michaelgalloy.com/2015/05/12/mg_log-sublogger-level-h andling-change.html

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Illegal operand error with window,/free
Next Topic: help with write_gif - Image must be a byte matrix.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:00:23 PDT 2025

Total time taken to generate the page: 0.00444 seconds