Package org.apache.uima.util

Examples of org.apache.uima.util.Level


  public void actionPerformed(ActionEvent e) {
    JRadioButtonMenuItem item = (JRadioButtonMenuItem) e.getSource();

    // set UIMA framework log level with the given value
    for (int i = 0; i < MainFrame.logLevels.size(); i++) {
      Level level = (Level) MainFrame.logLevels.get(i);
      // search for selected log level
      if (level.toString().equals(item.getText())) {
        UIMAFramework.getLogger().setLevel(level);
      }
    }
  }
View Full Code Here


    Logger jsrLogger = java.util.logging.Logger.getLogger("org.apache.uima");
    while(jsrLogger.getLevel() == null) {
      jsrLogger = jsrLogger.getParent();
    }
       
    Level defaultLogLevel = (Level) logLevels.get(jsrLogger.getLevel().toString());
   
    // check message logging for root logger based on default log level
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.ALL), uimaLogger
            .isLoggable(Level.ALL));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINEST), uimaLogger
            .isLoggable(Level.FINEST));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINER), uimaLogger
            .isLoggable(Level.FINER));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINE), uimaLogger
            .isLoggable(Level.FINE));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.CONFIG), uimaLogger
            .isLoggable(Level.CONFIG));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.INFO), uimaLogger
            .isLoggable(Level.INFO));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.WARNING), uimaLogger
            .isLoggable(Level.WARNING));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.SEVERE), uimaLogger
            .isLoggable(Level.SEVERE));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.OFF), uimaLogger
            .isLoggable(Level.OFF));

    // check message logging for class logger based on default log level
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.ALL), classLogger
            .isLoggable(Level.ALL));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINEST), classLogger
            .isLoggable(Level.FINEST));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINER), classLogger
            .isLoggable(Level.FINER));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINE), classLogger
            .isLoggable(Level.FINE));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.CONFIG), classLogger
            .isLoggable(Level.CONFIG));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.INFO), classLogger
            .isLoggable(Level.INFO));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.WARNING), classLogger
            .isLoggable(Level.WARNING));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.SEVERE), classLogger
            .isLoggable(Level.SEVERE));
    Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.OFF), classLogger
            .isLoggable(Level.OFF));

    // reset class logger level to OFF
    // Logger.getLogger(this.getClass().getName()).setLevel(java.util.logging.Level.OFF);
    classLogger.setLevel(Level.OFF);
View Full Code Here

    String curLogLevel = LogManager.getLogManager().getProperty(".level");

    // create log config menu with available log levels
    Iterator levelIt = MainFrame.logLevels.iterator();
    while (levelIt.hasNext()) {
      Level level = (Level) levelIt.next();
      JRadioButtonMenuItem item = new JRadioButtonMenuItem(level.toString());
      // select current log level
      if (level.toString().equals(curLogLevel)) {
        item.setSelected(true);
      }
      item.addActionListener(new SetLogConfigHandler());
      levelGroup.add(item);
      logConfig.add(item);
View Full Code Here

TOP

Related Classes of org.apache.uima.util.Level

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.