Debugging - GameAnalytics/GA-SDK-CPP GitHub Wiki
The SDK is designed to be as silent as possible and use very few resources. You will therefore not get much information by default in your development console.
We have 2 different debug log types that can be enabled / disabled (at any time).
- info log
- verbose log
Info log
Short messages will be output when enabled explaining when some action is being performed by the SDK. Sometimes cropping text / values to make it more readable.
Enable info log when implementing the SDK - remember to turn it off in production!
gameanalytics::GameAnalytics::setEnabledInfoLog(true);
Info/GameAnalytics: Add DESIGN event: {eventId:someEvent, value:0}
Info/GameAnalytics: Add DESIGN event: {eventId:someOtherEvent, value:100}
Info/GameAnalytics: Add ERROR event: {severity:info, message:This is some in}
Verbose Log
Console output when each event is added (all fields) in JSON string format. This is the data being submitted to the GA servers for each event.
Enable verbose log when troubleshooting events.
gameanalytics::GameAnalytics::setEnabledVerboseLog(true);
This can result in a lot of text. When troubleshooting/debugging events it is therefore recommended to enable/disable when performing the action that need inspection.
Troubleshooting example.
// enable verbose log
gameanalytics::GameAnalytics::setEnabledVerboseLog(true);
// add event you need to troubleshoot / inspect
gameanalytics::GameAnalytics::addDesignEvent("Some:Event", 100);
// disable verbose log
gameanalytics::GameAnalytics::setEnabledVerboseLog(false);
Log file save location
The log files are saved here unless you have overwritten the location using GameAnalytics::configureWritablePath(const std::string& writablePath)
:
- Windows:
std::getenv("LOCALAPPDATA")\GameAnalytics
- Mac OSX:
std::getenv("HOME")/GameAnalytics