feat(logs): DEBUG_LOGS env to force full pipeline logs under billing
83b0649 hides raw yt-dlp/ffmpeg/debug spew from paid users. In local dev you
run with BILLING_ENABLED to test paid features but still want the debug logs,
so DEBUG_LOGS=true bypasses the filter regardless of billing.
This commit is contained in:
parent
880efb4d12
commit
be3dc665a3
2 changed files with 10 additions and 1 deletions
|
|
@ -13,3 +13,7 @@ AWS_S3_PUBLIC_BUCKET=your-public-bucket-name
|
|||
# proxy), pin the callback explicitly:
|
||||
# OAUTH_REDIRECT_URI=http://localhost:8000/api/auth/google/callback
|
||||
# FRONTEND_URL=http://localhost:5175
|
||||
|
||||
# Local dev: show the full pipeline logs (yt-dlp/ffmpeg/debug) in the UI even
|
||||
# when running in paid mode (BILLING_ENABLED). Cloud/prod leaves this unset.
|
||||
# DEBUG_LOGS=true
|
||||
|
|
|
|||
7
app.py
7
app.py
|
|
@ -42,6 +42,8 @@ DISABLE_YOUTUBE_URL = os.environ.get("DISABLE_YOUTUBE_URL", "false").lower() in
|
|||
# when BILLING_ENABLED is set. With the flag off, the app behaves exactly as the
|
||||
# self-hosted BYOK app does today (no extra dependencies required).
|
||||
BILLING_ENABLED = os.environ.get("BILLING_ENABLED", "").lower() in ("1", "true", "yes")
|
||||
# Force full pipeline logs to the client even under billing (local debugging).
|
||||
DEBUG_LOGS = os.environ.get("DEBUG_LOGS", "").lower() in ("1", "true", "yes")
|
||||
|
||||
if BILLING_ENABLED:
|
||||
import cloud
|
||||
|
|
@ -539,8 +541,11 @@ def _visible_logs(logs):
|
|||
their own instance can debug. Cloud shows only the pipeline's own friendly
|
||||
progress lines (emoji-prefixed, plus the worker's start/finish markers) and
|
||||
hides the raw yt-dlp / ffmpeg / debug spew from paying users.
|
||||
|
||||
DEBUG_LOGS=true forces the full output even under billing — for local dev
|
||||
where you run in paid mode but still want the raw logs.
|
||||
"""
|
||||
if not BILLING_ENABLED:
|
||||
if not BILLING_ENABLED or DEBUG_LOGS:
|
||||
return logs
|
||||
visible = []
|
||||
for ln in logs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue