Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: basic output question Date: Mon, 27 Jul 2015 22:25:28 -0400 Organization: Aioe.org NNTP Server Lines: 31 Message-ID: References: <635be647-55fb-43f9-8609-0320306ca853@googlegroups.com> <450dd941-b331-4f46-9e9c-e7db4033e0ca@googlegroups.com> <91961835-9633-4c29-968d-027ce3fb9ff7@googlegroups.com> <5592e61d$0$292$14726298@news.sunsite.dk> <16cd77ab-e259-40b5-8599-de59a7db5dbd@googlegroups.com> NNTP-Posting-Host: bLmKSxgyEsD8qtT7wjgUDQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:32172 On 6/30/2015 3:14 PM, e.d.programmer@gmail.com wrote: >>>>> On Monday, June 29, 2015 at 2:40:05 PM UTC-4, Russ P. wrote: >>>>>> So if I call printInformation with no arguments, the >>>>>> output goes to standard output, but if I give it a filename >>>>>> the output goes to the file. Is this the best way to do it, >>>>>> or is there a simpler/better way? I'd also like to be able >>>>>> to append the output to an existing file as well as create >>>>>> a new file. Thanks. >>> I just looked at java.util.logging.Logger and most of that seems >>> irrelevant when all you want to do is write messages to >>> System.out. >> >> Usually people at some point end up needing to do something more >> advanced that just writing to System.out. >> >> OP already reached that level. >> >>> In my static log class I just add the timestamp and calling >>> method and line number to every output line. I don't want to get >>> an instance of a logger object for every line to print much less >>> configure a handler or assign a level. >> >> Rolling file appenders, syslog integration, the ability to adjust >> log level etc. are important in most big applications. > > OP mentioned wanting to do System.out.println(). OP also mentioned wanting to write to a file. Arne