From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114c38,b2077f5b728fb9af X-Google-Attributes: gid114c38,public X-Google-Thread: 103376,b2077f5b728fb9af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-10 20:36:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada,comp.os.vxworks From: Ted Dennison Sender: usenet@www.newsranger.com References: <3ad31759$1@pull.gecm.com> Subject: Re: redirecting the standard output Message-ID: Date: Tue, 10 Apr 2001 21:00:36 GMT NNTP-Posting-Host: 209.208.22.130 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 986936436 209.208.22.130 (Tue, 10 Apr 2001 17:00:36 EDT) NNTP-Posting-Date: Tue, 10 Apr 2001 17:00:36 EDT Organization: http://www.newsranger.com Xref: supernews.google.com comp.lang.ada:6734 comp.os.vxworks:6398 Date: 2001-04-10T21:00:36+00:00 List-Id: In article , Stephen Leake says... > >Backing up a bit, why do you want to do this? I can guess that you >want to turn off some debugging output. It is _far_ better to define a >Debug_IO package, with a Boolean or Integer debug enabled variable. >Then have a style guide that says "Ada.Text_IO is _forbidden_ in >delivered code; use Debug_IO if you need debug output". We did something rather similar to this with our vxWorks program. We wrote a "Log" package that takes in messages in a task-safe manner (using a queue to prevent priority inversions), slaps a time stamp and severity level on them, then outputs them to standard IO and to a log file. The standard IO part can be turned off at runtime by tweaking a global variable (in vxWorks all exported globals can be modified at the command line). Individual developers and *strongly* discuraged from using Text_IO directly. When using a RTOS, I'd expect everyone to develop something along these lines. You can't deal with the random crashes and priority inversions that would be caused by unrestrained IO calls in a real-time application. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com