Mute Stanford coreNLP logging

后端 未结 5 1805
深忆病人
深忆病人 2021-01-14 20:42

First of all, Java is not my usual language, so I\'m quite basic at it. I need to use it for this particular project, so please be patient, and if I have omitted any relevan

5条回答
  •  自闭症患者
    2021-01-14 21:17

    Om's answer disables all logging. However, if you wish to still log errors then use:

    RedwoodConfiguration.errorLevel().apply();
    

    I also use jdk logging instead of slf4j logging to avoid loading slfj dependencies as follows:

    RedwoodConfiguration.javaUtilLogging().apply();
    

    Both options can be used together and in any order. Required import is:

    import edu.stanford.nlp.util.logging.RedwoodConfiguration;
    

提交回复
热议问题