{ "info": { "author": "Marshall Culpepper", "author_email": "marshall.law@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# logcat-color\nA colorful and highly configurable alternative to the `adb logcat` command from\nthe Android SDK.\n\n**Note**: logcat-color is targetted at OS X and Linux, and does not currently\nwork in Windows.\n\n# Installation\n\n**Installation with pip** (may require sudo)\n\n```bash\n$ [sudo] pip install logcat-color3\n```\n\n**Installation from source** (requires setuptools, may require sudo)\n\nTo get the source, simply [download and extract a release tarball](https://github.com/yan12125/logcat-color/releases).\nAlternatively, you can clone the logcat-color git repository directly:\n\n```bash\n$ git clone https://github.com/ya12125/logcat-color3.git\n```\n\nTo install logcat-color from the source directory, run:\n\n```bash\n$ python setup.py install\n```\n\n## Examples\n\nRun and colorify `adb logcat`\n\n```bash\n$ logcat-color\n```\n\nColorify an old logcat text file you have laying around\n\n```bash\n$ logcat-color < /path/to/my.log\n```\n\nPipe logcat-color to egrep for only the tags you care about\n\n```bash\n$ logcat-color -e | egrep '(Tag1|Tag2)'\n```\n\nRun logcat-color with a [custom profile](#profiles) for [filters](#profile_filters), colors, and custom arguments)\n\n```bash\n$ logcat-color \n```\n\nlogcat-color also supports most of the standard adb / logcat arguments, making it a suitable full-time replacement for `adb logcat`\n\n```bash\n$ alias logcat=/path/to/logcat-color\n$ logcat -e\n$ logcat -d\n$ logcat -s 123456789 -b radio -b main\n```\n\nFor command line usage documentation:\n\n```bash\n$ logcat-color --help\n```\n\n## Configuration\n\nlogcat-color supports a configuration file at `$HOME/.logcat-color`\n\nThe configuration file is simply a python script, with a few interesting variables\nand types available to it.\n\n**Sample .logcat-color**\n\n```bash\n# Full path to adb, default is to look at the environment variable ADB, or\n# fall back on using \"adb\" from the system PATH\nadb = \"/path/to/adb\"\n\n# Width of the TAG column, default is 20\ntag_width = 20\n\n# Width of the PID column, default is 8\npid_width = 8\n\n# Width of priority (log level) column, default is 3\npriority_width = 3\n\n# Whether or not to wrap the message inside a column. Setting this to False\n# enables easier copy/paste. default is True\nwrap = True\n```\n\n## Profiles\n\nProfiles live in the [logcat-color configuration file](#configuration), and\nallow logcat-color to customize ADB and logging even further.\n\nIn short, a single Profile can:\n\n* [Filter](#profile_filters) based on arbitrary log data.\n* Use custom adb command line arguments, devices, and log formats\n* Customize display and color configuration.\n\nA profile is created by simply calling the Profile python constructor with\nvarious named arguments. The only required argument is the Profile's `name`:\n\n```bash\nProfile(name = \"myProfile\", ...)\n```\n\nYou can then have logcat-color use this profile by providing it on the command\nline. For example:\n\n```bash\n$ logcat-color myProfile\n```\n\nTo customize the Profile, simply pass more named arguments to the `Profile`\nconstructor. This is a list of all the currently supported named arguments:\n\n* `buffers`: A list of logcat buffers to display. By default logcat uses only the\n `main` system buffer. See the [Android documentation for logcat buffers](https://developer.android.com/tools/debugging/debugging-log.html#alternativeBuffers)\n for more information.\n* `device`: Specifies the device this profile is intended for.\n Valid values: True (connect to first available device), or a string with\n the serial ID of the device as reported by `adb devices`\n* `emulator`: Similar to `device`, but providing `True` connects to the first\n available emulator instead.\n* `filters`: A list or tuple of [custom filters](#profile_filters).\n* `format`: The logcat format to use. By default logcat uses the `brief` format.\n See the [Android documentation for logcat formats](https://developer.android.com/tools/debugging/debugging-log.html#outputFormat)\n for more information.\n* `name`: The profile name (required).\n* `priorities`: A list or tuple of priority levels. logcat-color will exclude\n any messages that contain priorities not in this list.\n Valid priorities: `V` (verbose), `D` (debug), `I` (info), `W` (warn),\n `E` (error), `F` (fatal).\n* `tags`: A list, tuple, or dict of logcat tag names. logcat-color will exclude\n any messages that contain tags not in this list. When a dict is used, you can\n also assign custom colors to each tag.\n Valid tag colors: `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, `WHITE`\n* `wrap`: Whether or not to wrap the message column. Default is `True`.\n* `packages`: An array containing the packages that you want to filter on.\n this will be applied in addition to the filters.\n\nHere is an extended example:\n\n```bash\nProfile(name = \"radio\",\n # Specify a custom device\n device = \"device_name\",\n\n # Enable both radio and main buffers (-b radio -b main)\n buffers = (\"radio\", \"main\"),\n\n # Only pay attention to the RIL and RILC tags, and give them custom colors\n tags = {\n \"RIL\": BLUE,\n \"RILC\": GREEN\n },\n\n # Only look at these priority levels\n priorities = (\"I\", \"W\", \"E\"),\n\n # Use threadtime format to get date/time stamps and thread IDs\n format = \"threadtime\",\n\n # Some custom filters\n filters = (\n r\"My Custom Regex\",\n lambda data: data[\"message\"] == \"Custom filter\"\n ),\n)\n```\n\n### Filters\n\nFilters allow your profile to have complete control over what log data you\nactually see when you run logcat-color.\n\nlogcat-color will run each line of log output through the list of filters in\nyour profile. Only when the entire list of filters have accepted the line will\nit actually be displayed. This is the equivalent of logically ANDing the results\nof each filter. If you require different logic, you should use a custom function\nfilter, and combine the results of various filters manually.\n\nThere are currently two different kinds of filters:\n\n#### Regex filters\n\nWhen the regex matches the message portion of a line of logcat output, that line\nwill then be matched against the next filter. For example:\n\n```bash\n# A negated regex -- exclude any line that matches this\ndef negatedRegex(regex):\n return r\"^(?!.*\" + regex + \").*$\"\n\nProfile(...\n filters = (negatedRegex(r\"debugging: \"), r\"my custom regex\")\n)\n```\n\n#### Function filters\n\nWhen the function returns `True` for a line of log output, that line will then\nbe matched against the next filter. The function will be passed a `data`\ndictionary that contains all of the log data:\n\n* `\"priority\"`: One of the logcat priorities: `V` (verbose), `D` (debug),\n `I` (info), `W` (warn), `E` (error), `F` (fatal).\n Availability: All logcat formats.\n* `\"message\"`: The log message itself\n Availability: All logcat formats.\n* `\"tag\"`: The Tag of this log message.\n Availability: All logcat formats except `thread`.\n* `\"pid\"`: The PID of the process that logged the message (in string form).\n Availability: All logcat formats except `tag`.\n* `\"tid\"`: The ID of the thread that logged the message (in string form).\n Availability: `thread`, `threadtime`, and `long` formats.\n* `\"date\"`: The date of the log message (in string form).\n Availability: `time`, `threadtime`, and `long` formats.\n* `\"time\"`: The time of the log message (in string form).\n Availability: `time`, `threadtime`, and `long` formats.\n\nNotice that many of these fields are conditional based on the logcat output\nformat. Be careful when constructing the logic of function filters, as the field\nyou are filtering may not exist in the message!\n\nAn example of a function filter:\n\n```bash\n# only include messages from my app's tags\ndef onlyMyApp(data):\n # Tag isn't available in \"thread\" format, so use get() to be safe and\n # return None instead of raising an exception\n return data.get(\"tag\") in (\"MyAppTag1\", \"MyAppTag2\")\n\nProfile(...\n filters = (onlyMyApp)\n)\n```\n\n### Package Filters\n\nWhen you only care about a few (or one) application this will pass all\nmessages to you by that application.\n\n*Note*: This will require the application's startup message to be accessible\nvia the current logback trace. The best bet it to start logcat-color then\nstart the app.\n\nAn example of package filters\n\n```bash\nProfile(...\n packages = [ \"com.android.example\" ]\n)\n```\n\n## Screenshot\n![logcat-color screenshot of Boot2Gecko](https://img.skitch.com/20120629-jkeek3mbk2ibk9w75xqku88wpt.jpg)\n\n## Thanks\n\nThanks to [Jeff Sharkey](https://jsharkey.org) for the original script that logcat-color is based on, [coloredlogcat.py](https://jsharkey.org/logcat/).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yan12125/logcat-color", "keywords": "", "license": "Apache 2.0", "maintainer": "Chih-Hsuan Yen", "maintainer_email": "yan12125@gmail.com", "name": "logcat-color3", "package_url": "https://pypi.org/project/logcat-color3/", "platform": "", "project_url": "https://pypi.org/project/logcat-color3/", "project_urls": { "Homepage": "https://github.com/yan12125/logcat-color" }, "release_url": "https://pypi.org/project/logcat-color3/0.9.0/", "requires_dist": [ "colorama" ], "requires_python": "", "summary": "A colorful alternative to \"adb logcat\"", "version": "0.9.0" }, "last_serial": 5129467, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "0e6e03486664df5eb8d90acf75d4203e", "sha256": "a44cb6e6e8db64f440415ab2fa86eed1f2651da6e19f6fa6f392604d68be18f7" }, "downloads": -1, "filename": "logcat_color3-0.9.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0e6e03486664df5eb8d90acf75d4203e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19673, "upload_time": "2019-04-11T15:12:46", "url": "https://files.pythonhosted.org/packages/c0/0a/5f5b03be047ee64182917a2267553e2d0bf8992983834b7a1ae4d6c3ff20/logcat_color3-0.9.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98e64c3975e4faa9de3a2d8f2aa316f3", "sha256": "57471841b59d0a456f6d3a971bb3701ca2fc9a8319735e9515c9de3cd2062c92" }, "downloads": -1, "filename": "logcat-color3-0.9.0.tar.gz", "has_sig": true, "md5_digest": "98e64c3975e4faa9de3a2d8f2aa316f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22598, "upload_time": "2019-04-11T15:12:48", "url": "https://files.pythonhosted.org/packages/80/ac/1f92a3ad8d5db013fb9920e7d42092bec710a21ac3ce7c3dab4758448b5e/logcat-color3-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e6e03486664df5eb8d90acf75d4203e", "sha256": "a44cb6e6e8db64f440415ab2fa86eed1f2651da6e19f6fa6f392604d68be18f7" }, "downloads": -1, "filename": "logcat_color3-0.9.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0e6e03486664df5eb8d90acf75d4203e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19673, "upload_time": "2019-04-11T15:12:46", "url": "https://files.pythonhosted.org/packages/c0/0a/5f5b03be047ee64182917a2267553e2d0bf8992983834b7a1ae4d6c3ff20/logcat_color3-0.9.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98e64c3975e4faa9de3a2d8f2aa316f3", "sha256": "57471841b59d0a456f6d3a971bb3701ca2fc9a8319735e9515c9de3cd2062c92" }, "downloads": -1, "filename": "logcat-color3-0.9.0.tar.gz", "has_sig": true, "md5_digest": "98e64c3975e4faa9de3a2d8f2aa316f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22598, "upload_time": "2019-04-11T15:12:48", "url": "https://files.pythonhosted.org/packages/80/ac/1f92a3ad8d5db013fb9920e7d42092bec710a21ac3ce7c3dab4758448b5e/logcat-color3-0.9.0.tar.gz" } ] }