开发者

How do I log entering/exiting a function?

开发者 https://www.devze.com 2023-02-28 03:51 出处:网络
I want to do some logging like this: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

I want to do some logging like this:

public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);

   mLog = Logger.getLogger(getLocalClassName());
   mLog.setLevel(Level.ALL);

开发者_StackOverflow中文版   mLog.entering("onCreate", "onCreate");
   mLog.exiting("onCreate", "onCreate");
}

but logcat window in eclipse show nothing.

Why? Thanks a lot.


Use android.util.Log.

Then try

public void onCreate(Bundle savedInstanceState) 
{
        super.onCreate(savedInstanceState);

        Log.i("onCreate", "entering");

        Log.i("onCreate", "exiting");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消