summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-03-13 23:25:59 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-03-13 23:25:59 -0400
commitaced3e4562b3feac81a11e392ede8b1b30c40345 (patch)
treecb11927a67884b3d917cd209ad512438c3f48a19
parentfc59cdb772c38d334f9ae776aab738e5eb81d988 (diff)
new main mode
-rw-r--r--dslog/Main.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/dslog/Main.java b/dslog/Main.java
index 0d35e8b..159ee00 100644
--- a/dslog/Main.java
+++ b/dslog/Main.java
@@ -24,9 +24,25 @@ class Main {
});
}
+ 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) {
- ls(dirname);
+ wch(dirname);
}
}
}