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

@ -10,4 +10,6 @@ crate-type = ["cdylib"]
[dependencies]
androscalpel_serializer = { version = "0.1.0", path = "../androscalpel_serializer" }
log = "0.4.20"
pyo3 = "0.19.0"
pyo3-log = "0.8.3"

View file

@ -1,4 +1,5 @@
//! Representation of an apk.
use log::info;
use pyo3::prelude::*;
use crate::{Class, DexString, Error, Result};
@ -92,11 +93,11 @@ impl Apk {
| ACC_ENUM))
!= 0
{
println!(
info!(
"Unexpected flags found in class_def_item.access_flags for {}: 0x{:x}",
<&DexString as Into<String>>::into(&name),
class_item.access_flags
); // TODO: better logging
);
}
self.classes.push(Class {
name,

View file

@ -14,7 +14,7 @@ pub struct Class {
pub name: DexString,
/// If the class is visible everywhere
#[pyo3(get, set)]
pub is_public: bool, // TODO: is it possible to not be public non a non inner class?
pub is_public: bool,
/// If the class is subclassable
#[pyo3(get, set)]
pub is_final: bool,

View file

@ -145,6 +145,7 @@ impl DexString {
/// Androscalpel.
#[pymodule]
fn androscalpel(_py: Python, m: &PyModule) -> PyResult<()> {
pyo3_log::init();
m.add_class::<Class>()?;
m.add_class::<Apk>()?;
m.add_class::<DexString>()?;