use log instead of print

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2023-09-01 15:03:11 +02:00
parent 625420c5f6
commit 0ae6ce5e88
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
10 changed files with 54 additions and 19 deletions

View file

@ -1,4 +1,5 @@
use crate::{EncodedValue, Error, ReadSeek, Result, Serializable, Uleb128};
use log::warn;
use std::io::Write;
// To derive Serializable
@ -60,9 +61,8 @@ impl Serializable for EncodedAnnotation {
let mut idx_0 = elements[0].name_idx;
for idx_1 in elements.iter().map(|elt| elt.name_idx).skip(1) {
if idx_0 > idx_1 {
// TODO: use proper logging
println!(
"Waring while deserializing EncodedAnnotation: element must be sorted in increasing order by string_id index, found {idx_0:?} before {idx_1:?}"
warn!(
"while deserializing EncodedAnnotation: element must be sorted in increasing order by string_id index, found {idx_0:?} before {idx_1:?}"
);
}
idx_0 = idx_1;