Logcat 在 AVD 上显示信息 3 次

发布于 2024-11-03 06:38:27 字数 3270 浏览 0 评论 0原文

使用 LogCat 时,日志会显示 3 次。谁能解释为什么会发生这种情况? 日志示例:

04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries

04-24 15:45:30.434: DEBUG/jdwp(351): JDWP shutting down net...

04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request

04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms

04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)

04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }

04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9

04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9

04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate

When using LogCat the logs are shown three times. Can anyone explain why this is happening?
A sample of the Log:

04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries

04-24 15:45:30.434: DEBUG/jdwp(351): JDWP shutting down net...

04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up

04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed

04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}

04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request

04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms

04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)

04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }

04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9

04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9

04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦开始←不甜 2024-11-10 06:38:27

这种事在我身上发生过几次。尝试重置 DDMS(这是 Eclipse 中的隐藏选项,查找“屏幕截图”按钮旁边的向下箭头)。

This happened to me a few times. Try resetting the DDMS (it's a hidden option in Eclipse, look for the down arrow next to the "Screenshot" button).

污味仙女 2024-11-10 06:38:27

如果您使用 Timber for Logging 等库,请检查您的 CustomApplication 类。
您可能会多次初始化您的库,例如:

public class CustomApplication extends Application {
  @Override public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
      Timber.plant(new DebugTree());
      Timber.plant(new DebugTree());
    }
  }
}

If you are using libraries like Timber for Logging, check your CustomApplication class.
You might be initializing your library multiple times like:

public class CustomApplication extends Application {
  @Override public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
      Timber.plant(new DebugTree());
      Timber.plant(new DebugTree());
    }
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文