{"id":13587179,"url":"https://github.com/flxo/rogcat","last_synced_at":"2025-04-12T19:48:50.254Z","repository":{"id":19245850,"uuid":"66565218","full_name":"flxo/rogcat","owner":"flxo","description":"A `adb logcat` wrapper","archived":false,"fork":false,"pushed_at":"2024-12-12T12:23:30.000Z","size":2757,"stargazers_count":237,"open_issues_count":3,"forks_count":25,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-12T19:48:35.700Z","etag":null,"topics":["adb","android","bridge","debugging","logcat","logging"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flxo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-25T14:30:06.000Z","updated_at":"2025-03-28T11:42:16.000Z","dependencies_parsed_at":"2024-11-06T14:28:05.509Z","dependency_job_id":"feba82dd-d752-4d9c-8219-f1716f017493","html_url":"https://github.com/flxo/rogcat","commit_stats":{"total_commits":439,"total_committers":15,"mean_commits":"29.266666666666666","dds":0.4715261958997722,"last_synced_commit":"860fc1fbe2ad0c5bba9868f0551d68a5b4f4df13"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxo%2Frogcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxo%2Frogcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxo%2Frogcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxo%2Frogcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flxo","download_url":"https://codeload.github.com/flxo/rogcat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625501,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","android","bridge","debugging","logcat","logging"],"created_at":"2024-08-01T15:06:04.263Z","updated_at":"2025-04-12T19:48:50.229Z","avatar_url":"https://github.com/flxo.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![CI](https://img.shields.io/github/actions/workflow/status/flxo/rogcat/ci.yml?branch=main)](https://github.com/flxo/rogcat/actions/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/rogcat.svg)](https://crates.io/crates/rogcat)\n[![Release](https://img.shields.io/github/release/flxo/rogcat.svg)](https://github.com/flxo/rogcat/releases)\n[![License](https://img.shields.io/github/license/flxo/rogcat.svg)](https://github.com/flxo/rogcat/blob/master/LICENSE)\n\n# rogcat\n\n...is a `adb logcat` wrapper. The `Android Debugging Bridge` (`adb`) is the default way to interact with a Android\ndevice during development. The `logcat` subcommand of `adb` allows access to `Androids` internal log buffers. `rogcat`\ntries to give access to those logs in a convenient way including post processing capabilities. The main feature probably\nis a painted and reformatted view. `rogcat` can read logs from\n\n- running `adb logcat` (default)\n- a custom command (`stdout`, `stderr`)\n- one or multiple files\n- `stdin`\n- connect to TCP port\n- A SocketCAN CAN device (Linux only)\n\nThe processing steps within a `rogcat` run include parsing of the input stream and applying filters (if provided).\n`rogcat` comes with a set of implemented in and output formats:\n\n- `csv:` Comma separated values\n- `raw:` Record (line) as captured\n- `html:` A static single page html with a static table. This option cannot be used as input format. The page layout needs some love...\n- `human:` A human friendly colored column based format. See screenshot\n- `json:` Single line JSON\n\nExcept the `human` and `html` format the output of `rogcat` is parseable by `rogcat`.\n\n![Screenshot](/screenshot.png)\n\n## Examples\n\nThe following examples show a subset of `rogcat's` features. _Please read `--help`!_\n\n### Live\n\nCapture logs from a connected device and display unconditionally. Unless configurated otherwise, `Rogcat` runs `adb logcat -b main -b events -b crash -b kernel`:\n\n`rogcat`\n\nWrite captured logs to `testrun.log`:\n\n`rogcat -o testrun.log`\n\nWrite captured logs to file `./trace/testrun-XXX.log` by starting a new file every 1000 lines. If `./trace` is not present\nit is created:\n\n`rogcat -o ./trace/testrun.log -n 1000` or `rogcat -o ./trace/testrun.log -n 1k`\n\n### stdin\n\nProcess `stdout` and `stderr` of `command`:\n\n`rogcat command` or `command | rogcat -`\n\n### Filter\n\nDisplay logs from `adb logcat` and filter on records where the tag matches `^ABC.*` along with _not_ `X` and the message includes `pattern`:\n\n`rogcat -t \"^ADB.*\" -t \\!X -m pattern`\n\nThe Read all files matching `trace*` in alphanumerical order and dump lines matching `hmmm` to `/tmp/filtered`:\n\n`rogcat -i trace* -m hmmm  -o /tmp/filtered`\n\nCheck the `--message` and `--highlight` options in the helptext.\n\n### TCP\n\nTo connect via TCP to some host run something like:\n\n`rogcat tcp://traceserver:1234`\n\n### SocketCAN\n\nTo open a SocketCAN device and read frames run:\n\n`rogcat can://can0`\n\nSocketCAN is a Linux only thing.\n\n### Bugreport\n\nCapture a `Android` bugreport. This only works for `Android` version prior 7:\n\n`rogcat bugreport`\n\nCapture a `Android` bugreport and write (zipped) to `bugreport.zip`:\n\n`rogcat bugreport -z bugreport.zip`\n\n### Log\n\nWrite message \"some text\" into the device log buffer (e.g annotations during manual testing):\n\n`rogcat log \"some text\"`\n\nSet level and tag or read from `stdin`:\n\n```sh\nrogcat-log\nAdd log message(s) log buffer\n\nUSAGE:\n    rogcat log [OPTIONS] [MESSAGE]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -l, --level \u003cLEVEL\u003e    Log on level [values: trace, debug, info, warn, error, fatal, assert, T, D, I, W, E, F, A]\n    -t, --tag \u003cTAG\u003e        Log tag\n\nARGS:\n    \u003cMESSAGE\u003e    Log message. Pass \"-\" to capture from stdin'\n```\n\n## Fuchsia\n\n`rogcat` can be used to read logs from a `Fuchsia` device. Use the `--fx` switch to run `ffx` instead of `adb logcat`.\nThe default `ffx` command is `ffx log --no-color --severity debug`.\n\nOf course `ffx` can be invoked manually with eg. `ffx log --no-color | rogcat -` or `rogcat \"ffx log --no-color\"`.\n\n## Installation\n\nBuilding `rogcat` requires Rust 2018 edition:\n\n```sh\ncargo install --path .\n```\n\nor grab one of the [binary releases](https://github.com/flxo/rogcat/releases) on the GitHub page.\n\nOn Debian based systems the package `libudev-dev` (and it's dependencies) is required for building.\n\n## Configuration\n\nWhen `rogcat` runs without any command supplied it defaults to running `adb logcat -b all`. The following options\ncan be overwritten in the `rogcat` config file `config.toml`. The location of the config file is platform specific:\n\n- MacOS: `$HOME/Library/Preferences/rogcat/config.toml`\n- Linux: `$HOME/.config/rogcat/config.toml`\n- Windows: `%HOME%/AppData/Roaming/rogcat/config.toml`\n\n### Restart\n\nBy default `rogcat` restarts `adb logcat` when that one exits. This is intentional behavior to make `rogcat` reconnect\non device power cycles or disconnect/reconnects. A `Windows 7` bug prevents `rogcat` from restarting `adb`. Place\n`restart = false` in the configuration file mentioned above to make `rogcat` exit when `adb` exits.\n\n### Buffer\n\nThe default behavior of `rogcat` is to dump `all` logcat buffers. This can be overwritten by selecting specific buffers in\nthe `rogcat` configuration file. e.g:\n\n```toml\nbuffer = [\"main\", \"events\"]\n```\n\n### Terminal settings\n\nSome parameters of the `human` format are adjustable via the config file:\n\n```sh\nterminal_bright_colors = false\nterminal_color = never\nterminal_hide_timestamp = true\nterminal_process_width_max = 16\nterminal_thread_width_max = 16\nterminal_no_dimm = true\nterminal_show_date = false\nterminal_tag_width = 20\n```\n\n## Profiles\n\nOptionally `rogcat` reads a (`toml` formated) configuration file if present. This configuration may include tracing profiles\n('-p') and settings. The possible options in the configuration file are a subset of the command line options. The configuration\nfile is read from the location set in the environment variable `ROGCAT_PROFILES` or a fixed pathes depending on your OS:\n\n- MacOS: `$HOME/Library/Preferences/rogcat/profiles.toml`\n- Linux: `$HOME/.config/rogcat/profiles.toml`\n- Windows: `%HOME%/AppData/Roaming/rogcat/profiles.toml`\n\nThe environment variable overrules the default path. See `rogcat profiles --help` or `rogcat profiles --examples`.\n\nExample:\n\n```toml\n[profile.a]\ncomment = \"Messages starting with A or a\"\nmessage_case_insensitive = [\"^A.*\"]\n\n[profile.B]\ncomment = \"Messages starting with B\"\nmessage = [\"^B.*\"]\n\n[profile.ABC]\nextends = [\"A\", \"B\"]\ncomment = \"Profiles A, B plus the following filter (^C.*)\"\nmessage = [\"^C.*\"]\n\n[profile.\"Comments are optional\"]\ntag = [\"rogcat\"]\n\n[profile.complex]\ncomment = \"Profiles can be complex. This one is probably very useless.\"\nhighlight = [\"blah\"]\nmessage = [\"^R.*\", \"!^A.*\", \"!^A.*\"]\ntag = [\"b*\", \"!adb\"]\n\n[profile.\"W hitespace\"]\ncomment = \"Profile names can contain whitespaces. Quote on command line...\"\n\n[profile.rogcat]\ncomment = \"Only tag \\\"rogcat\\\"\"\ntag = [\"^rogcat$\"]\n\n[profile.default]\ncomment = \"Default profile\"\n```\n\nTo check your setup, run `rogcat profiles --list` and select a profile for a run by passing the `-p/--profile` option.\n\nYou can create a special profile named `default` which will be used when no other profile is selected on the command line.\n\n## Usage\n\n```sh\nrogcat 0.4.8-pre\nFelix Obenhuber \u003cfelix@obenhuber.de\u003e\nA 'adb logcat' wrapper and log processor. Your config directory is \"/home/felix/.config/rogcat\".\n\nUSAGE:\n    rogcat [FLAGS] [OPTIONS] [COMMAND] [SUBCOMMAND]\n\nFLAGS:\n        --bright-colors     Use intense colors in terminal output\n    -d, --dump              Dump the log and then exit (don't block)\n        --ffx               Use ffx log instead of adb logcat\n        --help              Prints help information\n        --hide-timestamp    Hide timestamp in terminal output\n    -L, --last              Dump the logs prior to the last reboot\n        --no-dimm           Use white as dimm color\n        --overwrite         Overwrite output file if present\n        --restart           Restart command on exit\n        --show-date         Show month and day in terminal output\n    -V, --version           Prints version information\n\nOPTIONS:\n    -b, --buffer \u003cbuffer\u003e...\n            Select specific logd buffers. Defaults to main, events, kernel and crash\n\n        --color \u003ccolor\u003e                            Terminal coloring option [possible values: auto, always, never]\n    -s, --serial \u003cdev\u003e                             Forwards the device selector to adb\n    -a, --filename-format \u003cfilename-format\u003e\n            Select a format for output file names. By passing 'single' the filename provided with the '-o' option is\n            used (default).'enumerate' appends a file sequence number after the filename passed with '-o' option\n            whenever a new file is created (see 'records-per-file' option). 'date' will prefix the output filename with\n            the current local date when a new file is created [possible values: single, enumerate, date]\n    -f, --filter \u003cfilter\u003e...                       Regex filter on tag, pid, thread and message.\n        --format \u003cformat\u003e\n            Output format. Defaults to human on stdout and raw on file output [possible values: csv, html, human, json,\n            raw]\n    -H, --head \u003chead\u003e                              Read n records and exit\n    -h, --highlight \u003chighlight\u003e...\n            Highlight messages that match this pattern in RE2. The prefix '!' inverts the match\n\n    -i, --input \u003cinput\u003e...\n            Read from file instead of command. Use 'serial://COM0@115200,8N1 or similiar for reading a serial port\n\n    -l, --level \u003clevel\u003e\n            Minimum level [possible values: trace, debug, info, warn, error, fatal, assert, T, D, I, W, E, F, A]\n\n    -m, --message \u003cmessage\u003e...                     Message filters in RE2. The prefix '!' inverts the match\n    -M, --Message \u003cmessage-case-insensitive\u003e...    Same as -m/--message but case insensitive\n    -o, --output \u003coutput\u003e                          Write output to file\n    -p, --profile \u003cprofile\u003e                        Select profile\n    -P, --profiles-path \u003cprofiles-path\u003e            Manually specify profile file (overrules ROGCAT_PROFILES)\n    -n, --records-per-file \u003crecords-per-file\u003e      Write n records per file. Use k, M, G suffixes or a plain number\n    -t, --tag \u003ctag\u003e...                             Tag filters in RE2. The prefix '!' inverts the match\n    -T, --Tag \u003ctag-case-insensitive\u003e...            Same as -t/--tag but case insensitive\n        --tail \u003ctail\u003e                              Dump only the most recent \u003cCOUNT\u003e lines (implies --dump)\n\nARGS:\n    \u003cCOMMAND\u003e    Optional command to run and capture stdout and stdderr from. Pass \"-\" to d capture stdin'. If\n                 omitted, rogcat will run \"adb logcat -b all\" and restarts this commmand if 'adb' terminates\n\nSUBCOMMANDS:\n    bugreport      Capture bugreport. This is only works for Android versions \u003c 7.\n    clear          Clear logd buffers\n    completions    Generates completion scripts\n    devices        List available devices\n    help           Prints this message or the help of the given subcommand(s)\n    log            Add log message(s) log buffer\n```\n\n## Licensing\n\nSee `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflxo%2Frogcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflxo%2Frogcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflxo%2Frogcat/lists"}