Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #11665
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Mon, 30 Jan 2012 21:06:06 -0600 |
| Date | Mon, 30 Jan 2012 19:06:07 -0800 |
| From | Patricia Shanahan <pats@acm.org> |
| User-Agent | Mozilla/5.0 (Windows NT 5.2; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 |
| MIME-Version | 1.0 |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: how to read back the lines printed out to the console? |
| References | <99599fa8-013c-4132-ac9e-5987d9d5588e@o13g2000vbf.googlegroups.com> <d384ae13-d848-416d-bf13-3f4f8d20a48c@k28g2000yqn.googlegroups.com> |
| In-Reply-To | <d384ae13-d848-416d-bf13-3f4f8d20a48c@k28g2000yqn.googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Message-ID | <aKudnXVEcI0Cx7rSnZ2dnUVZ_tKdnZ2d@earthlink.com> (permalink) |
| Lines | 35 |
| X-Usenet-Provider | http://www.giganews.com |
| NNTP-Posting-Host | 75.11.53.36 |
| X-Trace | sv3-TQavGViiTOMZrMburJwv7oUljJGqdtZW1AaM3FoW+35xRiVUhv4btRWaN7E5xucMs63OjMJ/wFZwH4L!TO9utdf2YVTtdfYyJxN83m6gPr+j4g6+IZaLsAznuMUTZHiWRXCHPFCcuOrlFoauJZkTl7UJGGgw!yU0dcVipc9VuID+eEsbdnGUhzBycSngYF1Gc7zAvMt8= |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 2669 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11665 |
Show key headers only | View raw
On 1/30/2012 6:49 PM, frame wrote:
> Thank you very much for all the replies. Probably I didn't explain my
> question clear. After reading all the replies, I am sorry I still
> didn't get the idea to proceed.
>
> My problem is such: our finished Java program has many printing
> statements, e.g.
>
> System.out.println("step A: everything is ok");
> ...
> System.out.println("step B: computation starts now");
> ...
>
> if(so)
> {
> System.out.println("warning: temperature is too hot");
> }
>
> There are about 500 of those. When we run the program, all these
> messages show up on the console -- that's good. But now, we also want
> to keep those messages in a file. I have two ideas, but none of them
> is acceptable:
>
> 1)at the beginning of the program, I added a little piece of code(re-
> direct the System output to a file), now all the existing 500
> System.out.println(..) prints to a file, not the console any more --
> this is not good, because the program runs up to 5 hours, we hope to
> see the message progressively on the console. With this approach, we
> have to wait till the program finished and open the text file to read.
You are almost there. Instead of using a PrintStream subclass that
writes only to the console, or one that writes only to a file, you need
one that writes to both.
Patricia
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to read back the lines printed out to the console? frame <xsli2@yahoo.com> - 2012-01-30 12:03 -0800
Re: how to read back the lines printed out to the console? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-30 20:18 +0000
Re: how to read back the lines printed out to the console? Roedy Green <see_website@mindprod.com.invalid> - 2012-01-30 20:42 -0800
Re: how to read back the lines printed out to the console? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-01-30 14:18 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 19:34 -0500
Re: how to read back the lines printed out to the console? Patricia Shanahan <pats@acm.org> - 2012-01-30 14:37 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 20:08 -0500
Re: how to read back the lines printed out to the console? Patricia Shanahan <pats@acm.org> - 2012-01-30 17:18 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:00 -0500
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 19:33 -0500
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 19:35 -0500
Re: how to read back the lines printed out to the console? frame <xsli2@yahoo.com> - 2012-01-31 10:09 -0800
Re: how to read back the lines printed out to the console? Lew <noone@lewscanon.com> - 2012-01-31 11:11 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:39 -0500
Re: how to read back the lines printed out to the console? frame <xsli2@yahoo.com> - 2012-02-01 06:01 -0800
Re: how to read back the lines printed out to the console? Ian Shef <invalid@avoiding.spam> - 2012-02-01 19:15 +0000
Re: how to read back the lines printed out to the console? frame <xsli2@yahoo.com> - 2012-02-01 12:59 -0800
Re: how to read back the lines printed out to the console? Gene Wirchenko <genew@ocis.net> - 2012-02-01 14:00 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-02-01 19:27 -0500
Re: how to read back the lines printed out to the console? frame <xsli2@yahoo.com> - 2012-01-30 18:49 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:56 -0500
Re: how to read back the lines printed out to the console? Patricia Shanahan <pats@acm.org> - 2012-01-30 19:06 -0800
Re: how to read back the lines printed out to the console? Roedy Green <see_website@mindprod.com.invalid> - 2012-01-30 20:46 -0800
Re: how to read back the lines printed out to the console? Lew <noone@lewscanon.com> - 2012-01-30 21:18 -0800
Re: how to read back the lines printed out to the console? Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:36 -0500
Re: how to read back the lines printed out to the console? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-01-31 10:18 +0200
Re: how to read back the lines printed out to the console? Lew <noone@lewscanon.com> - 2012-01-31 11:15 -0800
Re: how to read back the lines printed out to the console? bugbear <bugbear@trim_papermule.co.uk_trim> - 2012-01-31 09:50 +0000
Re: how to read back the lines printed out to the console? Lew <noone@lewscanon.com> - 2012-01-31 11:17 -0800
csiph-web