During Android application development, we often want to display only the current log information of our own application. Unfortunately, since the process ID changes every time it is deployed to the phone, isn't it trying to find a log filtering tool that can solve this problem.
pidcat is all about filtering the application logs by matching the application packages. Then you can enjoy a more convenient development process.
here is an example.
pidcat toor
First install the rust environment
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then use cargo to install pidcat
cargo install --path .
```rust pidcat --help
A logcat colored command which displays only source entries for processes of a specific application package.
Usage: pidcat [OPTIONS] [process]...
Arguments: [process]... Name of the process to be filtered
Options:
-t, --tag
--tag-width <tag_width>
Set the tag show width. must >= 10
[default: 20]
-v, --revert-match
-b, --buffer
-c, --clear Clear (flush) the entire log and exit
-l, --level
-o, --output
--color <color>
Display in highlighted color to match priority
[default: auto]
[possible values: auto, always, never]
-i, --ignore-case Ignore case
-s
-h, --help Print help (see a summary with '-h')
-V, --version Print version ```
add dep for Cargo.toml
[dependencies]
pidcat="0.2.0"
You can use the following code to capture the adb logcat logs and process them twice according to your needs
```rust
use futures::StreamExt;
use pidcat::LogStream;
use pidcat::source::*;
async fn main() { let source = ADBSource::new(None);
let mut logs: LogStream = source.source().await;
while let Some(r) = logs.next().await {
if let Ok(log) = r {
println!("{}", log);
}
}
} ```
https://github.com/JakeWharton/pidcat https://github.com/flxo/rogcat