Skip to main content

An powerful log processor

Project description

# OkCat
An powerful log processor.

![](https://img.shields.io/badge/LogProcessor-OkCat-blue.svg)

The adb logcat handler is just update to JakeWharton's nice pidcat and I adapt it for more features.

You can using this log processor with define you own `log-line-regex` and it can work for any log: iOS, Android, Backend, etc.

You can using powerful tool to do many things for logs:

- highlight some keywords
![](https://github.com/Jacksgong/okcat/raw/master/arts/highlight-demo.png)
- trans msgs to some words
![](https://github.com/Jacksgong/okcat/raw/master/arts/trans-msg-demo.png)
- trans tags to some words
![](https://github.com/Jacksgong/okcat/raw/master/arts/trans-tag-demo.png)
- hide msg on logs
![](https://github.com/Jacksgong/okcat/raw/master/arts/hide-msg-demo.png)
- separate logs
![](https://github.com/Jacksgong/okcat/raw/master/arts/separate-demo.png)

## How to Install

```shell
# TODO
```

Now you can clone and execute `okcat.py` through `python okcat.py` temporary.

## How to Use

---

#### Simplest test

1. Create folder: `~/.okcat/`
2. Download: [filedownloader.yml](https://github.com/Jacksgong/okcat/raw/master/demo-conf/filedownloader.yml) and move to the `~/.okcat/` folder
3. Running: [Filedownloader-Demo](https://github.com/lingochamp/FileDownloader) on your Android phone
4. Execute: `./okcat -y=filedownloader`
5. Checkout result on terminal

![](https://github.com/Jacksgong/okcat/raw/master/arts/demo.png)

---

#### 1. Define your config file( Option but recommended ):

You can create your own yaml file as config file one `~/.okcat/` or the current folder you will execute `okcat` command, and the filename is free to create, when you execute the okcat, we will ask you the configure file name you want to apply.

```yml
package: cn.dreamtobe.geekassistant
log-line-regex: 'data,time,level,tag,process,thread,message = "(.\S*) (.\S*) ([A-Z])/([^:[]*):\[(\d*):([^] ]*)\] (.*?)$"'

separator-regex-list:
- 'MAIN,\d*,(\d*)

tag-keyword-list:
- mylog

trans-msg-map:
'connected-': "ConnectionMsg已经连接"
'disconnected-': "ConnectionMsg已断开"

trans-tag-map:
'MyActivityLifecycle': '[事件]'

hide-msg-list:
- 'heart-beat'

highlight-list:
- 'isSuccess='
```

## 2. Execute

You can just parse logcat from running adb:

```
./okcat -y=your_conf_name
```

You also can parse your log file through:

```
./okcat -y=your_conf_name your_log_path
```

## LICENSE

```
Copyright (C) 2017 Jacksgong(blog.dreamtobe.cn)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OkCat-1.0.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OkCat-1.0.0-py2.7.egg (38.5 kB view details)

Uploaded Egg

File details

Details for the file OkCat-1.0.0.tar.gz.

File metadata

  • Download URL: OkCat-1.0.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for OkCat-1.0.0.tar.gz
Algorithm Hash digest
SHA256 51ad2f1492741574d25243d2a22cbb82a92fba6e23a91e4e86bed40f91663295
MD5 0a2b2515787d52c039dbafebe2737d53
BLAKE2b-256 469d9da8d611bed1a0fb2a279f5ccdbadbbdaf5d1cceee9c58ecac3c1dac10cc

See more details on using hashes here.

File details

Details for the file OkCat-1.0.0-py2.7.egg.

File metadata

  • Download URL: OkCat-1.0.0-py2.7.egg
  • Upload date:
  • Size: 38.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for OkCat-1.0.0-py2.7.egg
Algorithm Hash digest
SHA256 f64741fa4244eae99eb8602aa64734960f7553e56ca22d71e4f7cfc414a2ea58
MD5 75887749325ebd052e04dd46ce07bdc8
BLAKE2b-256 4f66f9364d283386aa0d32be663b74737c432d93d67d767fe76c5c8c019c5e8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page