Path: news.net.uni-c.dk!noatun.mjolner.dk!mail-to-news From: Peter Andersen Newsgroups: comp.lang.beta Subject: Re: Programm Trace Date: Fri, 19 Jan 2001 10:29:03 +0100 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 53 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: <9492eu$bb6$1@news.net.uni-c.dk> References: <20010118160649.26709.qmail@noatun.mjolner.dk> NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.net.uni-c.dk 979897630 11622 130.225.4.254 (19 Jan 2001 09:47:10 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Fri, 19 Jan 2001 09:47:10 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010118160649.26709.qmail@noatun.mjolner.dk>; from wolfgang.beutner@cityweb.de on Mon, Jan 15, 2001 at 09:55:09PM +0100 X-Original-Message-ID: <20010119102902.D4531@mjolner.com> Xref: news.net.uni-c.dk comp.lang.beta:12696 Wolfgang Beutner writes: > Hello everybody. > > I am let me say a total newcomer with beta. I learned about the > existence of it by incident. I am a software engineer and earn the daily > living by writing software for unix-systems using pure C. Each of our > programs opens a tracefile at start and the different routines write > into this file. The level of detail is controlled via > environment-variables. > I would like to have something similar for my beta experiments, but > there is no convnient way of doing this. I either have to generate an > object and pass it around as parameter or each invocation of my > tracefunction has to open the file again and do the initialisation each > time. That seems quite inefficent to me. I would appreciate a stream > like screen, for instance, which can be used from every object once the > stream is opened and set up with it's associated variables. I have been > busy reading the betabook and the documentation, but did not get the > real idea. Maybe there is a possibilty I did not discover so far ;-) > > Your advice would be very much appreaciated. > > Wolfgang Beutner, Dortmund. How about (haven't tried it - just an idea): trace: @file(# ... #); stdout: ^stream; do (* Setup trace file *) '...' -> trace.path; trace.openWrite; (* Save reference to original screen object *) screen[] -> stdout[]; (* Replace screen reference with trace file object *) trace[] -> screen[] ... 'Hello, ' -> screen.putline; (* Ends up in file *) 'World' -> putline; (* Ends up in file too *) 'Goodbye, World' -> stdout.putline; (* Ends in shell *) ... trace.close; Sincerely, Peter Andersen, Mjolner Informatics