android logcat listener

This class can be used to get notified when new lines are added to the internal android-log. I used this class to send logdata when using reLog. This might be not the method to gain maximum performance, but it does its job pretty well.
“DELAY” defines the amount of milliseconds the thread should wait before checking it new lines appeared.
“LINES” defines the amount of lines the Handler can load into its buffer. Lower values mean more performance, but may lose some lines when a bunch of lines are added in the same moment.

Download .java from here.

Create a new listener:

LogHandler lh = new LogHandler(){
    public void onLineAdd(String line){
        //do something with the line
    }
};

Dont forget to destroy the listener when you dont need it anymore:

lh.stop();