Package org.apache.uima.util

Examples of org.apache.uima.util.Logger


    if (getContext().getConfigParameterValue("FinalCount") != null) {
      finalCount = ((Integer) getContext().getConfigParameterValue("FinalCount")).intValue();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, name + " initialized");
  }
View Full Code Here


    if (getContext().getConfigParameterValue("AnnotatorName") != null) {
      name = ((String) getContext().getConfigParameterValue("AnnotatorName")).trim();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, name + " initialized");
  }
View Full Code Here

    if (getContext().getConfigParameterValue("FinalCount") != null) {
      finalCount = ((Integer) getContext().getConfigParameterValue("FinalCount")).intValue();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, "NAnnotator initialized");
  }
View Full Code Here

    if (getContext().getConfigParameterValue("FinalCount") != null) {
      finalCount = ((Integer) getContext().getConfigParameterValue("FinalCount")).intValue();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, "SimpleAnnotator initialized");
  }
View Full Code Here

        resMgr = UIMAFramework.newDefaultResourceManager();
      }

      // get a Logger for this class and set its ResourceManager so that
      // UIMA extension ClassLoader is used to locate message digests.
      Logger logger = UIMAFramework.getLogger(this.getClass());
      logger.setResourceManager(resMgr);
     
      ConfigurationManager configMgr = null;
      if (aAdditionalParams != null) {
        configMgr = (ConfigurationManager)aAdditionalParams.get(PARAM_CONFIG_MANAGER);
      }
      if (configMgr == null) {
        configMgr = UIMAFramework.newConfigurationManager();
      }

      // create and initialize UIMAContext
      mUimaContextAdmin = UIMAFramework.newUimaContext(logger, resMgr, configMgr);

    } else {
      // configure logger of the UIMA context so that class-specific logging
      // levels and UIMA extension classLoader will work
      // get a Logger for this class and set its ResourceManager so that
      // UIMA extension ClassLoader is used to locate message digests.
      Logger logger = UIMAFramework.getLogger(this.getClass());
      logger.setResourceManager(mUimaContextAdmin.getResourceManager());
      mUimaContextAdmin.setLogger(logger);
    }

    // if this is a local resource (instantiated from a ResourceCreationSpecifier),
    // initialize the ResourceManager and UIMA Context.
View Full Code Here

    if (getContext().getConfigParameterValue("AnnotatorName") != null) {
      name = ((String) getContext().getConfigParameterValue("AnnotatorName")).trim();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, name + " initialized");
  }
View Full Code Here

    if (getContext().getConfigParameterValue("FinalCount") != null) {
      finalCount = ((Integer) getContext().getConfigParameterValue("FinalCount")).intValue();
    }

    // write log messages
    Logger logger = getContext().getLogger();
    logger.log(Level.CONFIG, "NAnnotator initialized");
  }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.apache.uima.jcas.jcasgen_gen.IError#newError(int, java.lang.String)
     */
    public void newError(int severity, String message, Exception ex) {
      Logger log = UIMAFramework.getLogger();
      log.log(logLevels[severity], "JCasGen: " + message); //$NON-NLS-1$
      System.out.println(Messages.getString("MultiPageEditor.JCasGenErr") //$NON-NLS-1$
              + message);
      if (null != ex)
        ex.printStackTrace();
      if (IError.WARN < severity) {
View Full Code Here

                  annotatorClassName, mDescription.getSourceUrlString() }, e);
    }

    // Set Logger, to enable annotator-specific logging
    UimaContextAdmin uimaContext = getUimaContextAdmin();
    Logger logger = UIMAFramework.getLogger(annotatorClass);
    logger.setResourceManager(this.getResourceManager());
    uimaContext.setLogger(logger);

    // initialize AnalysisComponent
    try {
      mAnalysisComponent.initialize(getUimaContext());
View Full Code Here

   * Get the logging level of the logger for TAFAnnotator. TAF only supports three levels of
   * logging. All logging levels INFO and below are mapped to the TAF message level.
   */
  public static int getLoggingLevel() {

    Logger uimacppLogger = UIMAFramework.getLogger(UimacppAnalysisComponent.class);

    if (uimacppLogger.isLoggable(Level.FINEST) || uimacppLogger.isLoggable(Level.FINER)
            || uimacppLogger.isLoggable(Level.FINE) || uimacppLogger.isLoggable(Level.CONFIG)
            || uimacppLogger.isLoggable(Level.INFO)) {
      return TAF_LOGLEVEL_MESSAGE;
    } else if (uimacppLogger.isLoggable(Level.WARNING)) {
      return TAF_LOGLEVEL_WARNING;
    } else if (uimacppLogger.isLoggable(Level.SEVERE)) {
      return TAF_LOGLEVEL_ERROR;
    } else {
      return TAF_LOGLEVEL_OFF;
    }
  }
View Full Code Here

TOP

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

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.