How to record the activities of an android phone
===

I'm hoping to write a tweak to record all activities running on a rooted Android phone. For example, I want to record the information such as:

 - 2012-07-31 15:03 app1:Activity01:onCreate() 
 - 2012-07-31 15:04 app1:Activity01:onStart()
 - ...
 - 2012-07-31 15:05 app1:Activity01:onPause() 
 - 2012-07-31 15:05 app2:Activity01:onResume()

Is is possible to do it? If so, please kindly tell me where to find the related information, books or domain knowledge I should study to accomplish this task. I'm new on Android programming but familiar with C++ and Java.

Thanks a lot!