comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: redirecting the standard output
Date: Tue, 10 Apr 2001 21:00:36 GMT
Date: 2001-04-10T21:00:36+00:00	[thread overview]
Message-ID: <UvKA6.2483$FY5.173949@www.newsranger.com> (raw)
In-Reply-To: upuekpwjq.fsf@gsfc.nasa.gov

In article <upuekpwjq.fsf@gsfc.nasa.gov>, 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



  parent reply	other threads:[~2001-04-10 21:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 14:32 redirecting the standard output Martin Dowie
2001-04-10 15:01 ` redirecting the standard output to different std outputs? Frank
2001-04-10 16:17   ` Mark Biggar
2001-04-10 20:38     ` James Rogers
2001-04-13 16:23   ` Tucker Taft
2001-04-10 16:08 ` redirecting the standard output Stephen Leake
2001-04-10 16:46   ` Stephen Leake
2001-04-10 17:13     ` Smark
2001-04-10 21:00   ` Ted Dennison [this message]
2001-04-11  7:32   ` Martin Dowie
2001-04-11 12:04     ` Stephen Leake
2001-04-11 14:15       ` Martin Dowie
2001-04-12  1:41     ` tmoran
2001-04-12  7:08       ` Martin Dowie
2001-04-10 16:46 ` Smark
2001-04-11 12:06   ` Stephen Leake
2001-04-11 14:11     ` Martin Dowie
2001-04-11  0:04 ` Jeff Creem
2001-04-11  9:48 ` Graham Baxter
2001-04-12 12:23   ` Martin Dowie
2001-04-12 14:01     ` Smark
2001-04-12 19:52       ` martin.m.dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox