デバッグガイド
アノテーションプロジェクトのデバッグフラグ、ログオプション、トラブルシューティングのヒント。
デバッグガイド
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)注意: CLIフラグは設定ファイルの値よりも優先されます。例えば、-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スタイリングを検査
- アプリケーション:セッションストレージとCookieを確認
コンソールログの再有効化
--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には--debugフラグが必要です」
--debug-phaseオプションは--debugも指定されている場合にのみ動作します:
# Wrong
potato start config.yaml --debug-phase=annotation
# Correct
potato start config.yaml --debug --debug-phase=annotationフェーズが見つからない
指定されたフェーズが設定に存在しない場合、以下を確認してください:
- フェーズ名のスペルが正しい
- フェーズがYAML設定で定義されている
- カスタムページの場合、設定の正確なページ名を使用している
関連情報
- プレビューCLI - サーバーを実行せずに設定を検証
- ユーザーシミュレーター - シミュレーションユーザーによる自動テスト
- ローカル開発 - 開発環境のセットアップ
実装の詳細については、ソースドキュメントを参照してください。