Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38768
| From | Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: java still worthwhile? |
| Date | 2019-02-28 23:16 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <q59ml1$jau$1@dont-email.me> (permalink) |
| References | (1 earlier) <q54ghl$ivg$1@news.albasani.net> <c1185f.vne.17.1@news.alt.net> <q54lcj$79u$1@news.albasani.net> <q5679j$5jp$1@dont-email.me> <q56s7g$f7g$1@news.albasani.net> |
On 2019-02-27 21:33, Martin Gregorie wrote: > On Wed, 27 Feb 2019 15:36:30 +0100, Daniele Futtorovic wrote: > >> On 2019-02-27 01:24, Martin Gregorie wrote: >>> Writing trace output to a circular buffer that only gets dumped at a >>> crash or fatal error is also good for long-running processes >> >> Much agreed. Out of curiosity, how do you handle the trigger? > > Its boringly straight-forward. I have a ReportError class that writes all > tracing, warning and error messages to stderr. It also implements a trace > level concept to make tracing verbosity controllable as well as turning > tracing on or off for the current run. Trace level zero is no tracing. > Increasing the trace level increases the amount of detail output. Since > the first parameter of the various trace() methods is the trace level, a > programmer can use the trace level as he sees fit to control what it > traced. I usually use level 1 to trace top level method exit, level 2 > adds tracing top-level method entry and higher levels to add > progressively more details (contents of local variables, nested method > calls, etc.). > > ReportError also has methods that enable a circular buffer and configure > its size. Using them causes all trace() messages to be written to the > buffer. Whenever ReportError warn() or error() methods are called the > circular buffer contents are output immediately before the "Warning: xxxx" > or "Error: xxxx" message. The only difference between the two (apart from > the prefix) is that error() ends the run while warn() doesn't. Thanks. No logging framework? Or at least, none of the established ones? Is that really a good idea? -- DF.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
java still worthwhile? dale <dale@dalekelly.org> - 2019-02-26 17:25 -0500
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-02-26 18:37 -0500
Re: java still worthwhile? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-02-27 15:36 +0100
Re: java still worthwhile? Martin Gregorie <martin@mydomain.invalid> - 2019-02-27 20:33 +0000
Re: java still worthwhile? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-02-28 23:16 +0100
Re: java still worthwhile? Martin Gregorie <martin@mydomain.invalid> - 2019-02-28 23:24 +0000
Re: java still worthwhile? Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-02-27 07:28 -0500
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-02-27 09:32 -0500
Re: java still worthwhile? Eric Douglas <e.d.programmer@gmail.com> - 2019-02-27 05:18 -0800
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-02-27 16:34 -0500
Re: java still worthwhile? Joerg Meier <joergmmeier@arcor.de> - 2019-03-01 11:10 +0100
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-03-01 10:11 -0500
Re: java still worthwhile? Eric Douglas <e.d.programmer@gmail.com> - 2019-03-01 07:22 -0800
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-03-01 13:34 -0500
Re: java still worthwhile? Arne Vajhøj <arne@vajhoej.dk> - 2019-03-01 22:07 -0500
Re: java still worthwhile? Joerg Meier <joergmmeier@arcor.de> - 2019-03-05 09:40 +0100
Re: java still worthwhile? dale <dale@dalekelly.org> - 2019-03-05 09:33 -0500
Re: java still worthwhile? Arne Vajhøj <arne@vajhoej.dk> - 2019-03-01 22:09 -0500
csiph-web