HeidelTime / heideltime

A multilingual, cross-domain temporal tagger developed at the Database Systems Research Group at Heidelberg University.
GNU General Public License v3.0
342 stars 67 forks source link

Getting access to the logger of Heideltime #86

Closed Nelly-Barret closed 1 year ago

Nelly-Barret commented 3 years ago

Hi developers!

I'm using Heideltime in my project to extract dates from many texts. I'm currently working on a Java project which includes Heideltime as a Maven dependancy. Since my project has a lot of text files to analyse, the output that I get is very verbose. Indeed, for each text I got this piece of output:

Apr 08, 2021 9:05:35 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: HeidelTimeStandalone initialized with language english
Apr 08, 2021 9:05:35 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone readConfigFile
INFO: trying to read in file lib/heideltime/config-heideltime.props
Apr 08, 2021 9:05:37 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: HeidelTime initialized
Apr 08, 2021 9:05:37 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: JCas factory initialized
Apr 08, 2021 9:05:37 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
INFO: Processing started

When I run my project on more than tens of documents, you can easily imagine the number of lines that my output got... (see my attached screenshot, and this is just the half of my output...)

Screenshot 2021-04-07 at 16 30 11

So my questions are:

Finally, I would like to congratulate developers and authors to provide such a nice and easy-to-use tool! 🎉

Thanks in advance for considering my question!

Nelly B.

Nelly-Barret commented 1 year ago

I found how to set the logger level to OFF: LogManager.getLogManager().getLogger("HeidelTimeStandalone").setLevel(java.util.logging.Level.OFF);.

In case this might help anybody.

kenadianu commented 1 year ago

A more specific example,

HeidelTimeStandalone heidelTime = new HeidelTimeStandalone();

java.util.logging.logger htLogger = java.utillogging.LogManager.getLogManager().getLogger("HeidelTimeStandalone");
htLogger.setLevel(java.util.logging.Level.OFF);

heidelTime = new HeidelTimeStandalone(Language.ENGLISH,DocumnetType.NARRATIVES,OutputType.TIMEML,"./config.props",POSTagger.NO);