{"id":26538805,"url":"https://github.com/ujiro99/logcatf","last_synced_at":"2025-03-21T23:30:02.756Z","repository":{"id":57527351,"uuid":"48916507","full_name":"ujiro99/logcatf","owner":"ujiro99","description":"A Command line tool for format Android Logcat.","archived":false,"fork":false,"pushed_at":"2016-03-05T18:27:08.000Z","size":2174,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T00:15:24.805Z","etag":null,"topics":["adb","android","cli","format-android-logcat","golang","library","logcat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ujiro99.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-02T16:45:45.000Z","updated_at":"2023-09-08T17:05:17.000Z","dependencies_parsed_at":"2022-09-18T04:40:41.051Z","dependency_job_id":null,"html_url":"https://github.com/ujiro99/logcatf","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujiro99%2Flogcatf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujiro99%2Flogcatf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujiro99%2Flogcatf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujiro99%2Flogcatf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ujiro99","download_url":"https://codeload.github.com/ujiro99/logcatf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244884376,"owners_count":20526221,"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","cli","format-android-logcat","golang","library","logcat"],"created_at":"2025-03-21T23:30:02.206Z","updated_at":"2025-03-21T23:30:02.723Z","avatar_url":"https://github.com/ujiro99.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logcatf  [![Build Status](https://travis-ci.org/ujiro99/logcatf.svg?branch=master)](https://travis-ci.org/ujiro99/logcatf)  [![Coverage Status](https://coveralls.io/repos/ujiro99/logcatf/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/ujiro99/logcatf?branch=master)\n\nA Command line tool for format Android Logcat.\n\nUse like this.\n```bash\n$ adb logcat -v time | logcatf --color\n```\n\nOutput:\n![ScreenShot](./screenshot.png?raw=true \"Logcatf\")\n\n\n## Examples\n\n```bash\n# show time, pid and message formatted.\n$ adb logcat -v time | logcatf \"%t %4i %m\"\n\n# output to csv format.\n$ adb logcat -v threadtime | logcatf --to-csv \u003e logcat.csv\n\n# get screencap on Exception\n$ adb logcat -v time | logcatf -o \"MY_APP.*Error\" -c \"adb shell screencap -p /sdcard/a.png\"\n```\n\n\n## Install\n\nYou can get binary from github release page.\n\n[-\u003e Release Page](https://github.com/ujiro99/logcatf/releases)\n\nor, use `go get`:\n\n```bash\n$ go get github.com/ujiro99/logcatf\n```\n\n\n## Basic Usage\n\n```bash\n$ adb logcat -v time | logcatf \"%t, %m\"\n```\n\nAvailable Format:\n\n| format | long ver. |\n|:------:|:---------:|\n|   %t   | %time     |\n|   %a   | %tag      |\n|   %p   | %priority |\n|   %i   | %pid      |\n|   %I   | %tid      |\n|   %m   | %message  |\n\nOther Flags:\n\n|  Flag | description              |\n|------:|-------------------------:|\n|   %a  | left-align               |\n|  %8a  | min-width 8, right-align |\n| %-8a  | min-width 8, left-align  |\n| %8.8a | width 8, right-align     |\n\n\nDefault Format:\n\n    \"%t %p %a: %m\"\n\n\n## Options\n\n\n### execute commands\n\nYou can execute other commands when a keyword matched to Logcat.\n\n    -o, --on=ON              regex to trigger a COMMAND.\n    -c, --command=COMMAND    COMMAND will be executed on regex matched.\n    \n* In COMMAND, you can use parsed logcat value using keyword same as format or environment variables.\n\n```bash\nex) -o \"MY_APP.*Error\" -c \"echo %m \u003e error.log\"\n    -o \"MY_APP.*Error\" -c \"echo \\${message} \u003e error.log\"  # linux, mac\n    -o \"MY_APP.*Error\" -c \"echo %message% \u003e error.log\"    # Windows\n```\n\n* Command's stdout is redirected to stderr of logcatf.\n* You can use multiple -o / -c pairs.\n \n\n### Output CSV\n\noutput to CSV format.\n\n        --to-csv             output to CSV format. double-quote will be escaped.\n        --encode=ENCODE      output character encode. { utf-8 | shift-jis | euc-jp | iso-2022-jp }\n\n* if use on Windows, encode will be used shift-jis.\n\n\n### Color\n\nspecify output Color.\n\n```\n    --color            enable ANSI color. ( defalult = false )\n    --color-v=COLOR    - color for verbose.\n    --color-d=COLOR    - color for debug.\n    --color-i=COLOR    - color for information.\n    --color-w=COLOR    - color for warning.\n    --color-e=COLOR    - color for error.\n    --color-f=COLOR    - color for fatal.\n```\n\n* This function uses [mitchellh/colorstring](https://github.com/mitchellh/colorstring).\n* In format string, you can use color tags. \n\n```bash\nex) $ adb logcat | logcatf \"%t [invert] %a [reset] [_white_] %m\" --color --color-i \"cyan\"\n```\n\n\nAvailable Color Tags:\n\n|Foreground|             |Background |                  |\n|:--------|:-------------|:----------|:-----------------|\n|black    | dark_gray    |\\_black\\_  | \\_dark_gray\\_    |\n|red      | light_red    |\\_red\\_    | \\_light_red\\_    |\n|green    | light_green  |\\_green\\_  | \\_light_green\\_  |\n|yellow   | light_yellow |\\_yellow\\_ | \\_light_yellow\\_ |\n|blue     | light_blue   |\\_blue\\_   | \\_light_blue\\_   |\n|magenta  | light_magenta|\\_magenta\\_| \\_light_magenta\\_|\n|cyan     | light_cyan   |\\_cyan\\_   | \\_light_cyan\\_   |\n|white    | light_gray   |\\_white\\_  | \\_light_gray\\_   |\n|default  |              |\\_default\\_|                  |\n\n|Attributes|           |\n:----------|:----------|\n|bold      |blink_slow |\n|dim       |blink_fast |\n|underline |invert     |\n\n| Reset      |\n|:-----------|\n| reset      |\n| reset_bold |\n\n\n## Contribution\n\n1. Fork ([https://github.com/ujiro99/logcatf/fork](https://github.com/ujiro99/logcatf/fork))\n1. Create a feature branch\n1. Commit your changes\n1. Rebase your local changes against the master branch\n1. Run test suite with the `go test ./...` command and confirm that it passes\n1. Run `gofmt -s`\n1. Create a new Pull Request\n\n\n## Author\n\n[ujiro99](https://github.com/ujiro99)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujiro99%2Flogcatf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fujiro99%2Flogcatf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujiro99%2Flogcatf/lists"}