-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a funtion to forge Android logd entry #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. Left some comments.
src/lib.rs
Outdated
//! To forge android logd entry: | ||
//! | ||
//! ``` | ||
//! android_logd_logger::low(buffer_id, pid, thread_id, secs, subsec_nanos, tag, priority, message).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a typo. Should be log
. Can you please also ensure that rustdoc catches the examples and tries to build them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for suggestion. I checked with the rustdoc
src/lib.rs
Outdated
crate::logd::log(&record); | ||
|
||
#[cfg(not(target_os = "android"))] | ||
println!("buffer: {:?}, tag: {:?}, message: {:?}", buffer_id, tag, message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please forward the records in the not android case as well. This keeps the equals format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, I was just not sure, I removed this conditional compilation
Remove the additional heavy dependency `chrono` by using `std::time::SystemTime` instead of secs and subsecs.
This PR adds a function that constructs a custom log entry.
I can be used it forge log entries, for example, to forward logs for 3rd party app to lodg