SDK 이벤트 로깅
앱인토스 Unity SDK는 런타임 이벤트를 자동으로 수집해요.[RuntimeInitializeOnLoadMethod]로 자동 초기화되어 별도의 코드 작성이 필요 없어요.
모든 이벤트의 log_type은 "unity_runtime"이에요.
이벤트 카테고리
| # | log_name | 트리거 | Rate Limit |
|---|---|---|---|
| 1 | unity_scene_transition | SceneManager.sceneLoaded/sceneUnloaded | 없음 |
| 2 | unity_low_memory | Application.lowMemory | 30초당 1회 |
| 3 | unity_error | Application.logMessageReceived (Error/Exception/Assert) | 60초당 10회 + 중복 제거 |
| 4 | unity_lifecycle | Application.focusChanged, Application.quitting | focus: 5초당 1회 |
| 5 | unity_frame_stall | Update() delta > 500ms | 60초당 5회 |
| 6 | unity_screen_change | Screen.width/height/orientation 변경 감지 | 2초당 1회 |
| 7 | unity_gc_collection | GC.CollectionCount() 변화 감지 | 60초당 5회 |
| 8 | unity_timescale_change | Time.timeScale 변경 감지 | 5초당 1회 |
이벤트별 파라미터
1. Scene 전환 (unity_scene_transition)
json
{
"event_type": "scene_loaded",
"scene_name": "GameScene",
"scene_build_index": 2,
"load_mode": "Single",
"previous_scene": "MainMenu",
"total_loaded_scenes": 3,
"time_since_start_sec": 12.5
}| 파라미터 | 설명 | event_type |
|---|---|---|
event_type | scene_loaded 또는 scene_unloaded | 전체 |
scene_name | Scene 이름 | 전체 |
scene_build_index | Build Settings 인덱스 | 전체 |
load_mode | Single 또는 Additive | scene_loaded만 |
previous_scene | 이전 활성 Scene 이름 | scene_loaded만 |
total_loaded_scenes | 현재 로드된 Scene 수 | 전체 |
time_since_start_sec | 앱 시작 이후 경과 시간 | 전체 |
2. Low Memory (unity_low_memory)
json
{
"event_type": "low_memory",
"time_since_start_sec": 120.5
}3. 에러/예외 (unity_error)
json
{
"event_type": "exception",
"message": "NullReferenceException: ...",
"stack_trace": "at GameManager.Update() ...",
"log_type": "Exception",
"time_since_start_sec": 45.2
}| 파라미터 | 설명 |
|---|---|
event_type | error, exception, assert |
message | 에러 메시지 (최대 500자) |
stack_trace | 스택 트레이스 (최대 200자) |
log_type | Unity LogType (Error, Exception, Assert) |
4. 앱 라이프사이클 (unity_lifecycle)
json
{ "event_type": "focus_changed", "has_focus": true, "time_since_start_sec": 120.5 }
{ "event_type": "quitting", "session_duration_sec": 300.5, "total_scenes_loaded": 5 }5. 프레임 스톨 (unity_frame_stall)
json
{
"event_type": "frame_stall",
"frame_duration_ms": 750,
"threshold_ms": 500,
"time_since_start_sec": 45.2
}6. 화면 변경 (unity_screen_change)
json
{ "event_type": "screen_resize", "width": 1920, "height": 1080, "previous_width": 1280, "previous_height": 720 }
{ "event_type": "orientation_change", "width": 1080, "height": 1920, "orientation": "Portrait", "previous_orientation": "LandscapeLeft" }7. GC 수집 (unity_gc_collection)
json
{
"event_type": "gc_collection",
"generation": 1,
"gen0_total": 45,
"gen1_total": 12,
"gen2_total": 3,
"time_since_start_sec": 60.0
}8. TimeScale 변경 (unity_timescale_change)
json
{
"event_type": "timescale_changed",
"time_scale": 0.0,
"previous_time_scale": 1.0,
"time_since_start_sec": 15.0
}안전장치
| 항목 | 설명 |
|---|---|
| try-catch | 모든 핸들러를 감싸서 로깅이 게임을 크래시하지 않아요 |
| 재진입 방지 | _isSending guard로 logMessageReceived 무한루프를 방지해요 |
| Rate Limiting | 카테고리별 고정 rate limit으로 과도한 전송을 방지해요 |