public static void minimalSetup(){ Properties props = new Properties(); props.setProperty("log.output", "stderr"); RedwoodConfiguration.apply(props); }
/** * Parses a properties file and applies it immediately to Redwood * @param props The properties to apply */ public static void apply(Properties props){ parse(props).apply(); }
/** * Configures the Redwood logger using a reasonable set of defaults, * which can be overruled by the supplied Properties file. * * @param props The properties file to overrule or augment the default configuration */ public static void apply(Properties props){ //--Tweak Properties //(output to stderr) if (props.getProperty("log.output") == null) { props.setProperty("log.output", "stderr"); } //(capture system streams) if (props.getProperty("log.captureStderr") == null) { props.setProperty("log.captureStderr", "true"); } //(apply properties) RedwoodConfiguration.apply(props); //--Strange Tweaks //(adapt legacy logging systems) JavaUtilLoggingAdaptor.adapt(); }
public void initLog(File logFilePath) throws IOException { RedwoodConfiguration.empty() .handlers(RedwoodConfiguration.Handlers.chain( RedwoodConfiguration.Handlers.showAllChannels(), RedwoodConfiguration.Handlers.stderr), RedwoodConfiguration.Handlers.file(logFilePath.toString()) ).apply(); // fh.setFormatter(new NewlineLogFormatter()); System.out.println("Starting Ssurgeon log, at "+logFilePath.getAbsolutePath()+" date=" + DateFormat.getDateInstance(DateFormat.FULL).format(new Date())); log.info("Starting Ssurgeon log, date=" + DateFormat.getDateInstance(DateFormat.FULL).format(new Date())); }
public static void main(String[] args) throws IOException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPTokensregexExtractor.class, args); KBPTokensregexExtractor extractor = new KBPTokensregexExtractor(DIR); List<Pair<KBPInput, String>> testExamples = KBPRelationExtractor.readDataset(TEST_FILE); extractor.computeAccuracy(testExamples.stream(), PREDICTIONS.map(x -> { try { return "stdout".equalsIgnoreCase(x) ? System.out : new PrintStream(new FileOutputStream(x)); } catch (IOException e) { throw new RuntimeIOException(e); } })); }
public static void main(String[] args) throws IOException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPSemgrexExtractor.class, args); KBPSemgrexExtractor extractor = new KBPSemgrexExtractor(DIR); List<Pair<KBPInput, String>> testExamples = KBPRelationExtractor.readDataset(TEST_FILE); extractor.computeAccuracy(testExamples.stream(), PREDICTIONS.map(x -> { try { return "stdout".equalsIgnoreCase(x) ? System.out : new PrintStream(new FileOutputStream(x)); } catch (IOException e) { throw new RuntimeIOException(e); } })); }
public static void main(String[] args) throws IOException, ClassNotFoundException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPEnsembleExtractor.class, args);
public static void main(String[] args) throws IOException { RedwoodConfiguration.standard().apply(); startTrack("main");
public static void main(String[] args) throws IOException, ClassNotFoundException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPStatisticalExtractor.class, args); // Fill command-line options
File logFile = new File(props.getProperty(HybridCorefProperties.LOG_PROP)); RedwoodConfiguration.current().handlers( RedwoodConfiguration.Handlers.file(logFile)).apply(); Redwood.log("Starting coref log");
public static void minimalSetup(){ Properties props = new Properties(); props.setProperty("log.output", "stderr"); RedwoodConfiguration.apply(props); }
public static void minimalSetup(){ Properties props = new Properties(); props.setProperty("log.output", "stderr"); RedwoodConfiguration.apply(props); } }
/** * Parses a properties file and applies it immediately to Redwood * @param props The properties to apply */ public static void apply(Properties props){ parse(props).apply(); }
/** * Parses a properties file and applies it immediately to Redwood * @param props The properties to apply */ public static void apply(Properties props){ parse(props).apply(); }
/** * Parses a properties file and applies it immediately to Redwood * @param props The properties to apply */ public static void apply(Properties props){ parse(props).apply(); }
public static void main(String[] args) throws IOException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPTokensregexExtractor.class, args); KBPTokensregexExtractor extractor = new KBPTokensregexExtractor(DIR); List<Pair<KBPInput, String>> testExamples = KBPRelationExtractor.readDataset(TEST_FILE); extractor.computeAccuracy(testExamples.stream(), PREDICTIONS.map(x -> { try { return "stdout".equalsIgnoreCase(x) ? System.out : new PrintStream(new FileOutputStream(x)); } catch (IOException e) { throw new RuntimeIOException(e); } })); }
public static void main(String[] args) throws IOException { RedwoodConfiguration.standard().apply(); // Disable SLF4J crap. ArgumentParser.fillOptions(KBPSemgrexExtractor.class, args); KBPSemgrexExtractor extractor = new KBPSemgrexExtractor(DIR); List<Pair<KBPInput, String>> testExamples = KBPRelationExtractor.readDataset(TEST_FILE); extractor.computeAccuracy(testExamples.stream(), PREDICTIONS.map(x -> { try { return "stdout".equalsIgnoreCase(x) ? System.out : new PrintStream(new FileOutputStream(x)); } catch (IOException e) { throw new RuntimeIOException(e); } })); }