package dslog; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.SortedMap; import java.util.Map; import java.util.TreeMap; class Main { public static void dslog2csv(String filename) throws IOException { try (DslogReader file = new DslogReader(Files.newInputStream(Paths.get(filename)))) { System.out.println("Format Version: "+file.version()); System.out.println("Start Time: "+file.startTime()); CsvWriter.Dslog2CSV(file, System.out); } } public static void ls(String dirname) throws IOException { LogDir.opendir(dirname).forEach((k,v)->{ System.out.println(v); }); } public static void wch(String dirname) throws IOException { LogDir.opendir(dirname).forEach((k,v)->{ boolean match = false; try (DseventsReader r = v.dsevents()) { if (r == null || r.version() != 3) return; while (r.hasNext()) { DseventsReader.Event e = r.next(); System.out.println(e.time +"\u001E"+e.message); } } catch (IOException e) { throw new RuntimeException(e); } }); } public static void main(String[] args) throws IOException { for (String dirname : args) { wch(dirname); } } }