Misc logging-cleanup/refactoring

* CrawlerJournal.java
    improve exception logging
    combine writeLine() methods to use varargs
* FrontierJournal.java
    improve exception logging
* ArchiveUtils.java
    replace ignored  count parameter with meaingful boolean one
* CrawlURI.java
    use updated ArchiveUtils method
This commit is contained in:
gojomo committed 2009-12-04 22:23:48 +00:00
1 parent d423af6838
commit 04012279fc
4 files changed
+20 -58

No files matched your search

@@ -802,7 +802,7 @@ public class CrawlJob implements Comparable<CrawlJob>, ApplicationListener {
return "<i>n/a</i>";
}
long timeElapsed = stats.getCrawlElapsedTime();
return ArchiveUtils.formatMillisecondsToConventional(timeElapsed,false);
return ArchiveUtils.formatMillisecondsToConventional(timeElapsed);
}
public Map<String,Object> threadReportData() {
@@ -164,8 +164,7 @@ public class FrontierJournal extends CrawlerJournal {
// wait until at least ENOUGH_TO_START_CRAWLING URIs queued
recoveredEnough.await();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
LOGGER.log(Level.WARNING,"interrupted",e);
}
}
@@ -219,7 +218,7 @@ public class FrontierJournal extends CrawlerJournal {
newJournal.writeLine(read);
}
} catch (URIException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING,"bad hopsViaString: "+read.substring(3),e);
}
}
if((lines%PROGRESS_INTERVAL)==0) {
@@ -328,8 +327,7 @@ public class FrontierJournal extends CrawlerJournal {
br.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
LOGGER.log(Level.WARNING,"problem importQueuesFromLog",e);
}
LOGGER.info("finished recovering frontier from "+source+" "
+qLines+" lines processed");