FamilySearch / gedcom5-java

Gedcom parsers
Apache License 2.0
68 stars 41 forks source link

Info Log when adding a GedcomTag #23

Closed twcardenas closed 3 years ago

twcardenas commented 3 years ago

Hello,

I was recently testing parsing a large gedcom that was generated by the Legacy software. While parsing I noticed that the reading of the gedcom took a long time to parse because there was an info log if there was a tag added as extension in ModelParser.addGedcomTag. (The tagging feature in Legacy seems to add a GedcomTag like this: _TAG1)

 private void addGedcomTag(ExtensionContainer ec, GedcomTag tag) throws SAXException {
      @SuppressWarnings("unchecked")
      List<GedcomTag> moreTags = (List<GedcomTag>)ec.getExtension(MORE_TAGS_EXTENSION_KEY);
      if (moreTags == null) {
         moreTags = new ArrayList<GedcomTag>();
         ec.putExtension(MORE_TAGS_EXTENSION_KEY, moreTags);
      }
      moreTags.add(tag);
      warning(new SAXParseException("Tag added as extension: "+joinTagStack()+" "+tag.getTag(), locator));
   }

I tested locally and moved that to a trace log so that it wouldn't appear when I didn't need it to, it improved performance greatly.

I was just curious as to why this was being logged as at the info level? Or would a lower log level be a better option? I do not see the information as being to helpful from the type of data being added as an extension.

stoicflame commented 3 years ago

Sure, we're happy to adjust. Go ahead and put together a pull request and we'll merge it.