aboutsummaryrefslogtreecommitdiff
path: root/ops
diff options
context:
space:
mode:
authorTill Höppner2016-03-16 15:14:03 +0100
committerTill Höppner2016-03-16 15:14:03 +0100
commit586461676df9abd2e011fbcb1bb7c784cdb2844c (patch)
tree6c66fa86c9cb9876757b099d7460ff17c39195a5 /ops
parent363e3722256c8e91bbd78bfcb2b1d3ffc83d9c0a (diff)
downloadilc-586461676df9abd2e011fbcb1bb7c784cdb2844c.tar.gz
ilc-586461676df9abd2e011fbcb1bb7c784cdb2844c.tar.xz
ilc-586461676df9abd2e011fbcb1bb7c784cdb2844c.zip
Add filtering functionality
Diffstat (limited to 'ops')
-rw-r--r--ops/Cargo.toml1
-rw-r--r--ops/src/lib.rs23
2 files changed, 3 insertions, 21 deletions
diff --git a/ops/Cargo.toml b/ops/Cargo.toml
index 6789aa2..85ca5a7 100644
--- a/ops/Cargo.toml
+++ b/ops/Cargo.toml
@@ -10,6 +10,7 @@ authors = ["Till Höppner <till@hoeppner.ws>"]
[dependencies]
log = "0.3.5"
chrono = "0.2.19"
+regex = "0.1.54"
ilc-base = "~0.2"
blist = "0.0.4"
bit-set = "0.3.0"
diff --git a/ops/src/lib.rs b/ops/src/lib.rs
index 2ebe51f..6fd4cab 100644
--- a/ops/src/lib.rs
+++ b/ops/src/lib.rs
@@ -5,9 +5,11 @@ extern crate bit_set;
extern crate serde;
extern crate chrono;
extern crate ilc_base;
+extern crate regex;
mod ageset;
pub mod stats;
+pub mod convert;
/// No-op log parsing
pub mod parse {
@@ -27,27 +29,6 @@ pub mod parse {
}
}
-/// Log format conversion
-pub mod convert {
- use ilc_base::{self, Context, Decode, Encode};
- use std::io::{BufRead, Write};
-
- /// Convert from one format to another, not necessarily different, format. In combination with a
- /// timezone offset, this can be used to correct the timestamps.
- /// Will return `Err` and abort conversion if the decoder yields `Err` or re-encoding fails.
- pub fn convert(ctx: &Context,
- input: &mut BufRead,
- decoder: &mut Decode,
- output: &mut Write,
- encoder: &Encode)
- -> ilc_base::Result<()> {
- for e in decoder.decode(&ctx, input) {
- try!(encoder.encode(&ctx, output, &try!(e)));
- }
- Ok(())
- }
-}
-
/// Last-seen of nicks
pub mod seen {
use ilc_base::{self, Context, Decode, Encode, Event};