Use logging.

This commit is contained in:
Paul Masurel
2016-09-15 00:00:14 +09:00
parent 346fc31ac2
commit 7969fb3a71
4 changed files with 22 additions and 18 deletions

View File

@@ -17,30 +17,30 @@ keywords = ["search", "information", "retrieval"]
[dependencies]
byteorder = "0.4"
memmap = "0.2"
lazy_static = "0.1.15"
lazy_static = "0.1"
regex = "0.1"
fst = "0.1.34"
fst = "0.1"
atomicwrites = "0.0.14"
tempfile = "2.0.0"
rustc-serialize = "0.3.16"
log = "0.3.5"
combine = "1.3.0"
tempdir = "0.3.4"
bincode = "0.4.0"
tempfile = "2.0"
rustc-serialize = "0.3"
log = "0.3"
combine = "1.3"
tempdir = "0.3"
bincode = "0.4"
libc = "0.2.6"
num_cpus = "0.2"
itertools = "0.4.16"
lz4 = "1.13.131"
time = "0.1.34"
itertools = "0.4"
lz4 = "1.13"
time = "0.1"
uuid = "0.1"
chan = "0.1.18"
crossbeam = "0.2.10"
chan = "0.1"
crossbeam = "0.2"
[dev-dependencies]
rand = "0.3.13"
rand = "0.3"
[build-dependencies]
gcc = "0.3.24"
gcc = "0.3"
# [profile.release]
# debug = true

View File

@@ -123,7 +123,7 @@ impl InnerHeap {
}
else {
if self.next_heap.is_none() {
println!("exceed heap size");
warn!("Exceeded heap size. The margin was apparently unsufficient. The segment will be committed right after indexing this very last document.");
self.next_heap = Some(Box::new(InnerHeap::with_capacity(self.buffer_len as usize)));
}
self.next_heap.as_mut().unwrap().allocate(num_bytes) + self.buffer_len

View File

@@ -51,8 +51,7 @@ fn index_documents(heap: &mut Heap,
for doc in document_iterator {
try!(segment_writer.add_document(&doc, &schema));
if segment_writer.is_buffer_full() {
println!("no more space committing.");
println!("seg max doc {}", segment_writer.max_doc());
info!("Buffer limit reached, flushing segment with maxdoc={}.", segment_writer.max_doc());
break;
}
}

View File

@@ -15,6 +15,9 @@ Tantivy is a search engine library.
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
#[macro_use]
extern crate fst;
extern crate byteorder;
@@ -35,6 +38,8 @@ extern crate itertools;
extern crate chan;
extern crate crossbeam;
#[cfg(test)] extern crate test;
#[cfg(test)] extern crate rand;