How to diagnose battery drain on Android device using logcat? I have been facing a severe battery drain issue on my official Cyanogenmod custom ROM. After discussing it on community forums, it was suggested that I use logcat for troubleshooting the problem. 

Problem:
Every time I disconnect my device after a complete charge, it drains battery  rapidly. It loses almost 50% in 15-20 mins. As mentioned above, I am planning to use logcat to try and capture the issue. I am planning to run adb logcat immediately after unplugging the phone from power.  However, I have used logcat in the past and found it very very difficult to extract specific data from the large output. I already went through the official logcat help page and Reading and Writing Logs to see if I could find something useful, but I could not find a solution for my problem.

Question:  


Is there anyway to use filters or some other feature where I can limit the logcat output to the stats which are only related to battery usage?
Can something like adb shell dumpsys batterystats &gt; batterystats.txt be of better use to me? If so, how do I use it to get what I want?


  

UPDATE:
BatteryStats for my drain can now be found here at Patebin. Also this is my Battery Historian Chart:
Are you sure, it's not any app that is draining your battery? You can find this out by booting you phone into Safe mode. Read How to boot your phone into safe mode for instructions. If your battery doesn't drain in Safe mode, try uninstalling the apps that you installed after you started seeing this weird behavior. If you are not able to figure out which app it is, try factory resetting it. Also, if the battery is draining so quickly it might very well be a faulty battery.