Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #11149
| From | Arved Sandstrom <asandstrom3minus1@eastlink.ca> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Logging Question |
| References | (6 earlier) <jdpkvp$jgd$1@dont-email.me> <QF5Mq.54294$cN1.19557@newsfe12.iad> <alpine.DEB.2.00.1201031525230.2163@urchin.earth.li> <N86Nq.17333$d52.16770@newsfe22.iad> <alpine.DEB.2.00.1201081402300.20221@urchin.earth.li> |
| Message-ID | <c0LOq.2651$%Y4.391@newsfe14.iad> (permalink) |
| Organization | Public Usenet Newsgroup Access |
| Date | 2012-01-09 19:47 -0400 |
On 12-01-08 10:08 AM, Tom Anderson wrote:
> On Wed, 4 Jan 2012, Arved Sandstrom wrote:
[ SNIP ]
>> new Enumeration() {
>>
>> int index = 0;
>> InputStream streams[] = new InputStream[] {bsBegin, in, bsEnd};
>>
>> @Override
>> public boolean hasMoreElements() {
>> return index < streams.length;
>> }
>>
>> @Override
>> public Object nextElement() {
>> return streams[index++];
>> }
>>
>> });
>
> Perhaps easier to do Collections.enumeration(Arrays.asList(bsBegin, in,
> bsEnd)).
No perhaps about it! Thanks for reminding me of that method. I need to
make time to review core APIs every so often.
>> The point here being is that the "real" input wasn't well-formed at
>> all, but by the time the parser sees it, it's fine.
>
> Yes, good trick. As a general pattern (topping and tailing some stream
> of items with start-container and end-container markers), it's useful in
> all sorts of places. Admittedly most when dealing with XML.
>
>> Completely different approach, and it might even be the most "valid"
>> approach, would be to consider each log "record" to be an XML fragment.
>
> Is there any support for getting parsers to parse multiple fragments
> from a single stream? If not, we're back to needing to frame the stream
> in some way, and then we might as well parse it as a sequence of
> documents. I'm pretty hazy on what the point of document fragments is,
> really.
>
> tom
>
In the formal sense I'm not sure I see the point of them either.
Apparently neither does W3C.
AHS
--
...wherever the people are well informed they can be trusted with their
own government...
-- Thomas Jefferson, 1789
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Logging Question Novice <novice@example..com> - 2011-12-31 21:27 +0000
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2011-12-31 17:25 -0500
Re: Logging Question Novice <novice@example..com> - 2012-01-01 01:46 +0000
Re: Logging Question Lew <lewbloch@gmail.com> - 2011-12-31 14:53 -0800
Re: Logging Question Novice <novice@example..com> - 2012-01-01 01:59 +0000
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2011-12-31 22:14 -0500
Re: Logging Question Novice <novice@example..com> - 2012-01-01 05:44 +0000
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-01 07:59 -0500
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-01 08:14 -0500
Re: Logging Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-01 19:06 -0400
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-01 18:24 -0500
Re: Logging Question Tom Anderson <twic@urchin.earth.li> - 2012-01-03 15:33 +0000
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-03 11:21 -0500
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-03 11:35 -0500
Re: Logging Question Tom Anderson <twic@urchin.earth.li> - 2012-01-04 14:42 +0000
Re: Logging Question Jeff Higgins <jeff@invalid.invalid> - 2012-01-04 11:43 -0500
Re: Logging Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-04 20:28 -0400
Re: Logging Question Donkey Hottie <donkey@fredriksson.dy.fi> - 2012-01-05 11:28 +0200
Re: Logging Question Tom Anderson <twic@urchin.earth.li> - 2012-01-08 14:08 +0000
Re: Logging Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-09 19:47 -0400
csiph-web