If something goes wrong in the query we need a default value for cnt_logs

Thank you unit-tests

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>