From 0b02eb456ceb7d3563e582c2cafc1fe50b0a988d Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Tue, 31 Aug 2021 20:28:16 +0300 Subject: [PATCH] chore(update): wrap long values into BStr for warn logs --- milli/src/update/index_documents/store.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/milli/src/update/index_documents/store.rs b/milli/src/update/index_documents/store.rs index 444b11e31..a2aa26e19 100644 --- a/milli/src/update/index_documents/store.rs +++ b/milli/src/update/index_documents/store.rs @@ -477,7 +477,7 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { if lmdb_key_valid_size(&key) { writer.insert(&key, &buffer)?; } else { - warn!("word {:?} is too large to be saved", word); + warn!("word {:?} is too large to be saved", word.as_bytes().as_bstr()); } } @@ -515,7 +515,7 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { if lmdb_key_valid_size(&key_buffer) { writer.insert(&key_buffer, &data_buffer)?; } else { - warn!("word {:?} is too large to be saved", word); + warn!("word {:?} is too large to be saved", word.as_bytes().as_bstr()); } } } @@ -542,7 +542,10 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { if lmdb_key_valid_size(&key_buffer) { sorter.insert(&key_buffer, &data)?; } else { - warn!("facet value {:?} is too large to be saved", original_value); + warn!( + "facet value {:?} is too large to be saved", + original_value.as_bytes().as_bstr() + ); } } @@ -614,7 +617,7 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { if lmdb_key_valid_size(&buffer) { sorter.insert(&buffer, original_value.as_bytes())?; } else { - warn!("facet value {:?} is too large to be saved", original_value); + warn!("facet value {:?} is too large to be saved", original_value.as_bytes().as_bstr()); } Ok(()) @@ -640,7 +643,7 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { if lmdb_key_valid_size(&key) { sorter.insert(&key, &buffer)?; } else { - warn!("word {:?} is too large to be saved", word); + warn!("word {:?} is too large to be saved", word.as_bytes().as_bstr()); } }