ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1509832 - in /ctakes/trunk: ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extr...
Date Fri, 02 Aug 2013 19:29:58 GMT
Author: chenpei
Date: Fri Aug  2 19:29:58 2013
New Revision: 1509832

URL: http://svn.apache.org/r1509832
Log:
CTAKES-219 - Made logging consistent in assertion and core projects

Modified:
    ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/RunZoner.java
    ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ZoneAnnotator.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/CasIndexer.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptConverterAnalysisEngine.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptLookup.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest2.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/CharacterOffsetToLineTokenConverterCtakesImpl.java
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/SingleDocumentProcessorCtakes.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/DocumentIdPrinterAnalysisEngine.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/knowtator/KnowtatorXMLParser.java

Modified: ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/RunZoner.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/RunZoner.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/RunZoner.java
(original)
+++ ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/RunZoner.java
Fri Aug  2 19:29:58 2013
@@ -8,7 +8,7 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.ctakes.core.util.CtakesFileNamer;
 import org.apache.ctakes.core.ae.DocumentIdPrinterAnalysisEngine;

Modified: ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ZoneAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ZoneAnnotator.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ZoneAnnotator.java
(original)
+++ ctakes/trunk/ctakes-assertion-zoner/src/main/java/org/mitre/medfacts/uima/ZoneAnnotator.java
Fri Aug  2 19:29:58 2013
@@ -6,8 +6,8 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 
 import org.apache.ctakes.assertion.zoner.types.Heading;
 import org.apache.ctakes.assertion.zoner.types.Subzone;
@@ -85,7 +85,7 @@ public class ZoneAnnotator extends JCasA
       sectionRegexFileInClasspathUri = sectionRegexFileInClasspathUrl.toURI();
     } catch (URISyntaxException e1)
     {
-      logger.log(Level.SEVERE, String.format("section regex file not found [%s]", sectionRegexFileUriString),
e1);
+      logger.error( String.format("section regex file not found [%s]", sectionRegexFileUriString),
e1);
       throw new AnalysisEngineProcessException(e1);
     }
 	  ZonerCli zonerCli =

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/CasIndexer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/CasIndexer.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/CasIndexer.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/CasIndexer.java
Fri Aug  2 19:29:58 2013
@@ -24,7 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptConverterAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptConverterAnalysisEngine.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptConverterAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptConverterAnalysisEngine.java
Fri Aug  2 19:29:58 2013
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.uima.analysis_component.JCasAnnotator_ImplBase;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptLookup.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptLookup.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptLookup.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/ConceptLookup.java
Fri Aug  2 19:29:58 2013
@@ -20,7 +20,7 @@ package org.apache.ctakes.assertion.medf
 
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.jcas.JCas;

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest.java
Fri Aug  2 19:29:58 2013
@@ -6,7 +6,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.ctakes.core.ae.DocumentIdPrinterAnalysisEngine;
 import org.apache.ctakes.core.cr.XMIReader;

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest2.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest2.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest2.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/CueWordTest2.java
Fri Aug  2 19:29:58 2013
@@ -6,7 +6,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.ctakes.core.ae.DocumentIdPrinterAnalysisEngine;
 import org.apache.ctakes.core.cr.XMIReader;

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/CharacterOffsetToLineTokenConverterCtakesImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/CharacterOffsetToLineTokenConverterCtakesImpl.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/CharacterOffsetToLineTokenConverterCtakesImpl.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/CharacterOffsetToLineTokenConverterCtakesImpl.java
Fri Aug  2 19:29:58 2013
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.uima.cas.FSIterator;
 import org.apache.uima.cas.Type;
@@ -105,19 +105,19 @@ public class CharacterOffsetToLineTokenC
   
   public int adjustOffsetToBestMatch(int original)
   {
-	  logger.finest("inside adjustOffsetToBestMatch");
+	  logger.debug("inside adjustOffsetToBestMatch");
 	  Integer newValue = tokenBeginEndTreeSet.floor(original);
 	  
 	  if (newValue == null)
 	  {
-		  logger.finest("no previous token begin or end found. using begin of first token.");
+		  logger.debug("no previous token begin or end found. using begin of first token.");
 		  newValue = tokenBeginEndTreeSet.first();
 	  } else
 	  {
 		  if (original == newValue)
-			  logger.finest("value not adjusted: " + original);
+			  logger.debug("value not adjusted: " + original);
 		  else
-			  logger.finest("found previous token boundary. original: " + original + "; new value:
" + newValue);
+			  logger.debug("found previous token boundary. original: " + original + "; new value:
" + newValue);
 	  }
 	  
 	  if (newValue == null)
@@ -125,18 +125,18 @@ public class CharacterOffsetToLineTokenC
 		  logger.info("no previous and no first token found!!");
 	  }
 	  
-	  logger.finest("end adjustOffsetToBestMatch");
+	  logger.debug("end adjustOffsetToBestMatch");
 	  
 	  return newValue;
   }
   
   public LineAndTokenPosition convertCharacterOffsetToLineToken(int characterOffset)
   {
-    logger.finest("entering CharacterOffsetToLineTokenConverterCtakesImpl.convertCharacterOffsetToLineToken()
with a characterOffset of: " + characterOffset);
+    logger.debug("entering CharacterOffsetToLineTokenConverterCtakesImpl.convertCharacterOffsetToLineToken()
with a characterOffset of: " + characterOffset);
     
-    logger.finest("before adjusting input character offset...");
+    logger.debug("before adjusting input character offset...");
     characterOffset = adjustOffsetToBestMatch(characterOffset);
-    logger.finest("after adjusting input character offset.");
+    logger.debug("after adjusting input character offset.");
     int baseTokenTypeId = BaseToken.type;
     
     ConstraintConstructorFindContainedBy constraintConstructorFindContainedBy = new ConstraintConstructorFindContainedBy(jcas);
@@ -156,14 +156,14 @@ public class CharacterOffsetToLineTokenC
 //    Annotation sentenceAnnotation = filteredIterator.next();
 //    Sentence sentence = (Sentence)sentenceAnnotation;
     
-    logger.finest("finding current or previous sentence for character offset " + characterOffset);
+    logger.debug("finding current or previous sentence for character offset " + characterOffset);
     Sentence sentence = findPreviousOrCurrentSentence(characterOffset);
     if (sentence == null)
     {
     	logger.info("current or previous sentence IS NULL!");
     } else
     {
-    	logger.finest("current or previous sentence -- id: " + sentence.getAddress() +
+    	logger.debug("current or previous sentence -- id: " + sentence.getAddress() +
     			"; begin: " + sentence.getBegin() + 
     			"; end: " + sentence.getEnd());
     }

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/SingleDocumentProcessorCtakes.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/SingleDocumentProcessorCtakes.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/SingleDocumentProcessorCtakes.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/i2b2/api/SingleDocumentProcessorCtakes.java
Fri Aug  2 19:29:58 2013
@@ -20,8 +20,8 @@ package org.apache.ctakes.assertion.medf
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 import java.util.regex.Pattern;
 
 import org.apache.uima.cas.ConstraintFactory;
@@ -253,7 +253,7 @@ public class SingleDocumentProcessorCtak
     {
       String message = "First token in sentence not found [#1]!!";
       Exception e = new RuntimeException(message);
-      logger.log(Level.SEVERE, message, e);
+      logger.error(message,e);
       return null;
     }
     Annotation firstTokenAnnotation = tokensInSentenceIterator.next();
@@ -269,7 +269,7 @@ public class SingleDocumentProcessorCtak
     {
         String message = "First token in sentence not found [#2]!!";
         Exception e = new RuntimeException(message);
-        logger.log(Level.SEVERE, message, e);
+        logger.error(message, e);
         return null;
     }
     Annotation beginTokenAnnotation = beginTokenInSentenceIterator.next();
@@ -283,7 +283,7 @@ public class SingleDocumentProcessorCtak
     {
         String message = "First token in sentence not found [#3]!!";
         Exception e = new RuntimeException(message);
-        logger.log(Level.SEVERE, message, e);
+        logger.error(message, e);
         return null;
     }
     Annotation endTokenAnnotation = beginTokenInSentenceIterator.next();

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/DocumentIdPrinterAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/DocumentIdPrinterAnalysisEngine.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/DocumentIdPrinterAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/DocumentIdPrinterAnalysisEngine.java
Fri Aug  2 19:29:58 2013
@@ -1,7 +1,7 @@
 package org.apache.ctakes.core.ae;
 
 
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.apache.ctakes.core.util.DocumentIDAnnotationUtil;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/knowtator/KnowtatorXMLParser.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/knowtator/KnowtatorXMLParser.java?rev=1509832&r1=1509831&r2=1509832&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/knowtator/KnowtatorXMLParser.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/knowtator/KnowtatorXMLParser.java
Fri Aug  2 19:29:58 2013
@@ -28,7 +28,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.logging.Logger;
+import org.apache.log4j.Logger;
 
 import org.jdom2.Element;
 import org.jdom2.JDOMException;
@@ -87,7 +87,7 @@ public class KnowtatorXMLParser {
         }
       }
     }
-    LOGGER.fine(String.format("Ignored annotators %s in %s", ignoredAnnotators, knowtatorXML));
+    LOGGER.debug(String.format("Ignored annotators %s in %s", ignoredAnnotators, knowtatorXML));
 
     // parse <stringSlotMention> elements
     Map<String, Slot<String>> stringSlots = new HashMap<String, Slot<String>>();
@@ -163,7 +163,7 @@ public class KnowtatorXMLParser {
     final Element child = element.getChild(cname);
     if (child == null) {
       String xml = this.xmlOutputter.outputString(element);
-      LOGGER.warning(String.format("no child <%s> for %s", cname, xml));
+      LOGGER.debug(String.format("no child <%s> for %s", cname, xml));
     }
     return new Option<Element>(child);
   }
@@ -172,7 +172,7 @@ public class KnowtatorXMLParser {
     final String value = element.getAttributeValue(attname);
     if (value == null) {
       String xml = this.xmlOutputter.outputString(element);
-      LOGGER.warning(String.format("no attribute %s for %s", attname, xml));
+      LOGGER.debug(String.format("no attribute %s for %s", attname, xml));
     }
     return new Option<String>(value);
   }



Mime
View raw message