A profile is created by simply calling the Profile python constructor withvarious named arguments. The only required argument is the Profile's `name`:

Profile(name = "myProfile", ...)

You can then have logcat-color use this profile by providing it on the commandline. For example:

$ logcat-color myProfile

To customize the Profile, simply pass more named arguments to the `Profile`constructor. This is a list of all the currently supported named arguments:

* `buffers`: A list of logcat buffers to display. By default logcat uses only the `main` system buffer. See the [Android documentation for logcat buffers]http://developer.android.com/tools/debugging/debugging-log.html#alternativeBuffers for more information.* `device`: Specifies the device this profile is intended for. Valid values: True (connect to first available device), or a string with the serial ID of the device as reported by `adb devices`* `emulator`: Similar to `device`, but providing `True` connects to the first available emulator instead.* `filters`: A list or tuple of [custom filters](#profile_filters).* `format`: The logcat format to use. By default logcat uses the `brief` format. See the [Android documentation for logcat formats]http://developer.android.com/tools/debugging/debugging-log.html#outputFormat for more information.* `name`: The profile name (required).* `priorities`: A list or tuple of priority levels. logcat-color will exclude any messages that contain priorities not in this list. Valid priorities: `V` (verbose), `D` (debug), `I` (info), `W` (warn), `E` (error), `F` (fatal).* `tags`: A list, tuple, or dict of logcat tag names. logcat-color will exclude any messages that contain tags not in this list. When a dict is used, you can also assign custom colors to each tag. Valid tag colors: `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, `WHITE`* `wrap`: Whether or not to wrap the message column. Default is `True`.* `packages`: An array containing the packages that you want to filter on. this will be applied in addition to the filters.

Filters allow your profile to have complete control over what log data youactually see when you run logcat-color.

logcat-color will run each line of log output through the list of filters inyour profile. Only when the entire list of filters have accepted the line willit actually be displayed. This is the equivalent of logically ANDing the resultsof each filter. If you require different logic, you should use a custom functionfilter, and combine the results of various filters manually.

There are currently two different kinds of filters:

#### Regex filters

When the regex matches the message portion of a line of logcat output, that linewill then be matched against the next filter. For example:

Notice that many of these fields are conditional based on the logcat outputformat. Be careful when constructing the logic of function filters, as the fieldyou are filtering may not exist in the message!

An example of a function filter:

# only include messages from my app's tags def onlyMyApp(data): # Tag isn't available in "thread" format, so use get() to be safe and # return None instead of raising an exception return data.get("tag") in ("MyAppTag1", "MyAppTag2")

Profile(... filters = (onlyMyApp) )

### Package Filters

When you only care about a few (or one) application this will pass allmessages to you by that application.

*Note*: This will require the application's startup message to be accessible via the current logback trace. The best bet it to start logcat-color thenstart the app.

Thanks to [Jeff Sharkey]http://jsharkey.org) for the original script that logcat-color is based on, [coloredlogcat.py]http://jsharkey.org/blog/2009/04/22/modifying-the-android-logcat-stream-for-full-color-debugging/)