Search code examples
android-studiogoogle-play-games

Viewing log statements from the library project BaseGameUtils in Android Studio


enter image description here

I have a work space set up per the Google Play Games Services documentation for Android Studio projects. I am doing some work with ButtonClicker project example. I am able to get log statements from ButtonClicker no problem by using a logcat filter on the package com.example.google.games.bc. I would like to be able to see log statements from BaseGameUtils as well. I have added some log statements to BaseGameUtils with a custom tag. As well I have set mDebugLog variables in BaseGameActivity and GameHelper to true. I am not getting any log statements from BaseGameUtils project to come out to logcat.

Just some time ago I had the log statement coming out from BaseGameUtils in Eclipse however now in Android Studio I can't see log statements from BaseGameUtils. At first I thought this must be an Android Studio problem however I cloned the same workspace in Eclipse and now eclipse is not displaying logcat from BaseGameUtils either.

My workspace can be cloned from: https://github.com/playgameservices/android-basic-samples (The directions are just to import project on the folder BasicSamples)

Is there a way to see logcat from BaseGameUtils?

I tried using the logcat from the command prompt as well. I get the same result. Can't see anything from the library project. My command line is like:

adb logcat -s ButtonClicker:* GameHelper:* BaseGameActivity:*

As well breakpoints are working only in ButtonClicker but not in BaseGameUtils.

Thank you


Solution

  • If you cloned (or refreshed) the samples recently, the problem may be that the samples do not extend BaseGameActivity any longer. This also means that GameHelper is not called either. There is an informative video about this change: Game On! - The death of BaseGameActivity.

    The command line for logcat should include BaseGameUtils:* to pickup messages from that class. You can also run logcat with no options and get all the messages, then figure out which tags to focus on.