Skip to content

Log Events

Overview

This guide shows you how to log events in your game.

Events provide insight on what is happening in your game, such as user actions, system events, or errors.

SohaGame SDK automatically logs some events, but some events need you to integrate manually.

Before you begin

List of events to integrate

Required events

  1. create_character: Log this event when creating a character and entering the game successfully (Required)

    [SohaSDK logCreateCharacterEventWithRoleName:role_name
                        roleID:role_id
                        roleLevel:role_level
                        serverName:server_name
                        serverID:server_id];
    

  2. set_role: Log this event after selecting character or level up (Required)

    [SohaSDK logSetRoleEventWithRoleName:role_name
                                  roleID:role_id 
                                  roleLevel:role_level 
                                  serverName:server_name 
                                  serverID:server_id];
    

Optional events

Custom event

[SohaSDK logGameEventWithEventName:@"<your_event_name>" value:eventData];

Log Events Flow

log events flow

Debug Events

When debugging in Xcode, in the Xcode Console Output, filter by the following keyword: [SohaSDK] Logging event. You will see console logs displaying the names of the logged events. Please verify if these events are complete and in the required order.

debug event

Warning

Skip events with names starting with "wv," for example: wv_login_playnow. These are default events of the SDK, and you don't need to worry about them.