디버깅 가이드
Potato 주석 프로젝트를 디버깅합니다 — 상세 로깅을 활성화하고, 디버그 플래그를 사용하며, 일반적인 오류 메시지를 해석하고, 데이터 로딩 및 스키마 검증 문제를 해결합니다.
Potato는 주석 프로젝트의 디버깅과 테스트를 돕기 위한 여러 명령줄 플래그와 구성 옵션을 제공합니다. 이러한 기능은 개발 및 문제 해결 과정에서 유용합니다.
서버 구성
YAML 구성 파일에서 직접 서버 설정을 구성할 수 있습니다:
server:
port: 8000 # Port to run on (default: 8000)
host: "0.0.0.0" # Host to bind to (default: 0.0.0.0)
debug: false # Enable Flask debug mode (default: false)참고: 명령줄 플래그는 구성 파일 값보다 우선합니다. 예를 들어 -p 9000은 server.port: 8000을 재정의합니다.
디버그 플래그
--debug
간소화된 인증으로 Potato를 디버그 모드로 실행합니다.
potato start config.yaml --debug효과:
- 일반적인 로그인 요구 사항을 우회합니다
- 상세 로깅을 활성화합니다
- 구성 변경 사항을 빠르게 테스트하는 데 유용합니다
--debug-log
시스템의 여러 부분에 대한 디버그 로깅 출력을 제어합니다.
potato start config.yaml --debug --debug-log=all옵션:
| 값 | 설명 |
|---|---|
all | UI(프론트엔드)와 서버(백엔드) 모두에 대한 로깅을 활성화합니다 |
ui | 프론트엔드 JavaScript 콘솔 로깅만 활성화합니다 |
server | 백엔드 Python 로깅만 활성화합니다 |
none | 모든 디버그 로깅을 비활성화합니다 |
예시:
# Debug frontend issues (JavaScript errors, UI state)
potato start config.yaml --debug --debug-log=ui
# Debug backend issues (API calls, data processing)
potato start config.yaml --debug --debug-log=server
# Full debugging (both frontend and backend)
potato start config.yaml --debug --debug-log=all
# Quiet mode - minimal output
potato start config.yaml --debug --debug-log=none--debug-phase
이전 단계를 거치지 않고 특정 단계나 페이지로 곧바로 건너뜁니다. 이는 주석 워크플로의 특정 부분을 테스트하는 데 유용합니다.
potato start config.yaml --debug --debug-phase=annotation필수 조건: --debug 플래그도 함께 설정되어 있어야 합니다.
유효한 단계 이름:
login- 로그인 페이지consent- 동의서prestudy- 사전 연구 설문instructions- 안내 페이지training- 교육 단계annotation- 주요 주석 단계poststudy- 사후 연구 설문done- 완료 페이지
예시:
# Jump directly to annotation (most common use case)
potato start config.yaml --debug --debug-phase=annotation
# Test post-study survey
potato start config.yaml --debug --debug-phase=poststudy
# Test a specific named page
potato start config.yaml --debug --debug-phase=my_custom_survey작동 방식:
debug_user라는 사용자를 자동으로 생성하고 로그인합니다- 지정된 단계 이전의 모든 단계를 건너뜁니다
- 사용자의 상태는 이전의 모든 단계를 완료한 것처럼 설정됩니다
디버그 플래그 조합
다양한 디버깅 시나리오를 위해 플래그를 조합할 수 있습니다:
# Quick annotation testing with minimal noise
potato start config.yaml --debug --debug-phase=annotation --debug-log=none
# Full debugging of annotation phase
potato start config.yaml --debug --debug-phase=annotation --debug-log=all
# Debug only backend while testing post-study
potato start config.yaml --debug --debug-phase=poststudy --debug-log=server기타 유용한 플래그
--verbose / -v
일반적인 작업 로깅을 위한 상세 출력을 활성화합니다.
potato start config.yaml -v--veryVerbose
상세한 내부 상태 정보를 포함한 매우 상세한 출력을 활성화합니다.
potato start config.yaml --veryVerbose--port / -p
특정 포트에서 실행합니다(여러 인스턴스를 실행할 때 유용함).
potato start config.yaml -p 8080브라우저 개발자 도구
명령줄 플래그 외에도 디버깅을 위해 브라우저 개발자 도구를 사용하세요:
- 콘솔: JavaScript 로그와 오류를 확인합니다(F12 또는 Cmd+Option+I)
- 네트워크: 프론트엔드와 백엔드 간의 API 호출을 모니터링합니다
- 요소: DOM과 CSS 스타일을 검사합니다
- 애플리케이션: 세션 저장소와 쿠키를 확인합니다
콘솔 로깅 다시 활성화
--debug-log=server 또는 --debug-log=none을 통해 UI 로깅이 비활성화된 경우, 브라우저 콘솔에서 다시 활성화하세요:
enableUIDebug();일반적인 디버깅 시나리오
새 주석 스키마 테스트
# Skip to annotation with full logging
potato start config.yaml --debug --debug-phase=annotation --debug-log=allAPI 문제 디버깅
# Server-only logging to focus on backend
potato start config.yaml --debug --debug-log=server그런 다음 브라우저의 네트워크 탭을 사용하여 요청/응답 데이터를 검사하세요.
사용자 흐름 테스트
# Start from the beginning with UI logging
potato start config.yaml --debug --debug-log=ui성능 테스트
# Minimal logging overhead
potato start config.yaml --debug --debug-phase=annotation --debug-log=none문제 해결
"debug-phase requires --debug flag"
--debug-phase 옵션은 --debug도 함께 지정된 경우에만 작동합니다:
# Wrong
potato start config.yaml --debug-phase=annotation
# Correct
potato start config.yaml --debug --debug-phase=annotation단계를 찾을 수 없음
지정된 단계가 구성에 존재하지 않는 경우 다음을 확인하세요:
- 단계 이름의 철자가 올바른지
- 단계가 YAML 구성에 정의되어 있는지
- 사용자 정의 페이지의 경우 구성에 있는 정확한 페이지 이름을 사용하세요
추가 자료
- Preview CLI - 서버를 실행하지 않고 구성을 검증합니다
- 사용자 시뮬레이터 - 시뮬레이션된 사용자를 통한 자동화 테스트
- 로컬 개발 - 개발 환경 설정
구현 세부 정보는 원본 문서를 참조하세요.