sandflow/regxmllib

Consistent treatment of warnings - stderr or stdout

Closed this issue · 2 comments

Does regxmllib always output all warnings to STDERR?

Some are also included in STDOUT as XML comments. I'm concerned that there might be others that are sent only to STDOUT, that I have not yet encountered. As a result a user has to:

  1. look in two places to be sure they've seen all warnings
  2. de-duplicate warnings

Clearly if all warnings always go to stderr then it's fine to ignore what's in the XML, but I've not found that documented anywhere. Is that the case?

Example

The following examples are encountered when parsing the BBC Archive example file LTA00000101.mxf. The Descriptive Metadata schemes used in this file are not yet registered.

STDERR:
Jul 15, 2015 9:55:24 AM com.sandflow.smpte.regxml.FragmentBuilder applyRule3
WARNING: Unknown property UL = urn:smpte:ul:060e2b34.01010101.0d040101.40010100 at group Preface
Jul 15, 2015 9:55:24 AM com.sandflow.smpte.regxml.FragmentBuilder applyRule3
WARNING: Unknown property UL = urn:smpte:ul:060e2b34.01010101.0d040101.40010200 at group Preface
Jul 15, 2015 9:55:24 AM com.sandflow.smpte.regxml.FragmentBuilder applyRule3
WARNING: Unknown Group UL = urn:smpte:ul:060e2b34.02530101.0d040101.01010000
Jul 15, 2015 9:55:24 AM com.sandflow.smpte.regxml.FragmentBuilder applyRule3
WARNING: Unknown Group UL = urn:smpte:ul:060e2b34.02530101.0d040101.01010000
STDOUT includes:
<!--Unknow Item
Key: urn:smpte:ul:060e2b34.01010101.0d040101.40010100
Data: 00000001-->
<!--Unknow Item
Key: urn:smpte:ul:060e2b34.01010101.0d040101.40010200
Data: 00000001-->

Does regxmllib always output all warnings to STDERR?

Yes. All errors and warnings are output through a logger, whose output can be reformatted and/or redirected.

The inline XML comments are a subset of all possible errors and merely for convenience (and a warning to the user of the XML document that some information might be missing).

Excellent. Thanks @palemieux