You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Shai Erera <se...@gmail.com> on 2013/05/12 16:26:50 UTC

SegmentInfos static infoStream (and logging in general)

Hi

Over at LUCENE-4975 (Replicator) I use InfoStream.getDefault() for logging
messages. That uses the static InfoStream, which means it affects all
replicator instances in the same JVM.

I remember that one of the reasons to not using Logger is because of its
static nature, i.e. once you turn on logging for e.g. o.a.l.index, it
affects all Lucene instances in the same JVM.

Before I went and made it an instance of e.g. ReplicationClient,
ReplicationHandler etc., I checked and noticed that SegmentInfos has *only*
a static infoStream, which is in fact a PrintStream, not even InfoStream.

Why doesn't SIS use InfoStream, and why is it static? Is it an error, or
was there a reason behind it?

Do we have any policy around logging / info-streaming? Like, having
replication output logging messages proved invaluable while debugging the
client. Should I just make all classes that have interesting log messages
InfoStream-aware by taking an InfoStream instance as a member? Is using
InfoStream.getDefault() considered an error? If so, maybe we should add it
to the forbidden API check?

Shai