Skip to content

Commit f7aaa68

Browse files
committed
feat: remove debug mode
1 parent 4418c06 commit f7aaa68

File tree

3 files changed

+19
-31
lines changed

3 files changed

+19
-31
lines changed

src/cli.py

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ def create_parser(cls) -> argparse.ArgumentParser:
360360

361361
# Diagnostics group
362362
g_diag = parser.add_argument_group("Diagnostics")
363-
g_diag.add_argument("--debug", action="store_true", help="Enable debug logging")
364363
g_diag.add_argument(
365364
"--yes", action="store_true", help="Assume 'yes' for prompts"
366365
)
@@ -1034,8 +1033,7 @@ async def run_list_runs(self, args: argparse.Namespace) -> int:
10341033

10351034
except (OSError, json.JSONDecodeError) as e:
10361035
self.console.print(f"[red]Error listing runs: {e}[/red]")
1037-
if args.debug:
1038-
self.console.print_exception()
1036+
self.console.print_exception()
10391037
return 1
10401038

10411039
async def run_show_run(self, args: argparse.Namespace) -> int:
@@ -1140,8 +1138,7 @@ async def run_show_run(self, args: argparse.Namespace) -> int:
11401138

11411139
except (OSError, json.JSONDecodeError) as e:
11421140
self.console.print(f"[red]Error showing run: {e}[/red]")
1143-
if args.debug:
1144-
self.console.print_exception()
1141+
self.console.print_exception()
11451142
return 1
11461143

11471144
async def run_prune(self, args: argparse.Namespace) -> int:
@@ -1238,8 +1235,7 @@ async def run_prune(self, args: argparse.Namespace) -> int:
12381235
return 0
12391236
except Exception as e:
12401237
self.console.print(f"[red]Prune failed: {e}[/red]")
1241-
if args.debug:
1242-
self.console.print_exception()
1238+
self.console.print_exception()
12431239
return 1
12441240

12451241
def _display_detailed_results(
@@ -1481,7 +1477,7 @@ async def run_orchestrator(self, args: argparse.Namespace) -> int:
14811477
setup_structured_logging(
14821478
logs_dir=args.logs_dir,
14831479
run_id=run_id,
1484-
debug=args.debug,
1480+
debug=True,
14851481
quiet=args.no_tui and args.output == "quiet",
14861482
no_tui=args.no_tui,
14871483
)
@@ -1638,8 +1634,7 @@ async def run_orchestrator(self, args: argparse.Namespace) -> int:
16381634
if args.output:
16391635
cli_config["output"] = args.output
16401636
# Server extension support removed
1641-
if args.debug:
1642-
cli_config.setdefault("logging", {})["level"] = "DEBUG"
1637+
# Always use full logging; no debug toggle
16431638
# Add CLI auth args
16441639
if hasattr(args, "oauth_token") and args.oauth_token:
16451640
cli_config.setdefault("runner", {})["oauth_token"] = args.oauth_token
@@ -1829,17 +1824,15 @@ def _red(k, v):
18291824
"logs_dir"
18301825
) or full_config.get("logs_dir", Path("./logs"))
18311826

1832-
# Log configuration sources (only in debug mode)
1833-
if full_config.get("debug") or args.debug:
1834-
self.console.print("[dim]Configuration loaded from:[/dim]")
1835-
if cli_config:
1836-
self.console.print(" - Command line arguments")
1837-
# No Pitaya-specific environment variables are used
1838-
if dotenv_config:
1839-
self.console.print(" - .env file")
1840-
if config:
1841-
self.console.print(f" - Config file: {args.config or 'pitaya.yaml'}")
1842-
self.console.print(" - Built-in defaults")
1827+
# Log configuration sources unconditionally
1828+
self.console.print("[dim]Configuration loaded from:[/dim]")
1829+
if cli_config:
1830+
self.console.print(" - Command line arguments")
1831+
if dotenv_config:
1832+
self.console.print(" - .env file")
1833+
if config:
1834+
self.console.print(f" - Config file: {args.config or 'pitaya.yaml'}")
1835+
self.console.print(" - Built-in defaults")
18431836

18441837
# Respect global session volume consent by setting env for runner
18451838
allow_global_session = bool(getattr(args, "allow_global_session_volume", False))
@@ -2218,8 +2211,7 @@ def emit_json(ev: dict):
22182211
return 2
22192212
except (OrchestratorError, DockerError, ValidationError) as e:
22202213
self.console.print(f"[red]Error: {e}[/red]")
2221-
if args.debug:
2222-
self.console.print_exception()
2214+
self.console.print_exception()
22232215
# Shutdown orchestrator
22242216
await self.orchestrator.shutdown()
22252217
return 1
@@ -2650,8 +2642,7 @@ async def monitor_shutdown():
26502642
return 2
26512643
except (OrchestratorError, DockerError, ValidationError) as e:
26522644
self.console.print(f"[red]Error: {e}[/red]")
2653-
if args.debug:
2654-
self.console.print_exception()
2645+
self.console.print_exception()
26552646
# Shutdown orchestrator
26562647
await self.orchestrator.shutdown()
26572648
return 1

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def get_default_config() -> Dict[str, Any]:
245245
"output": "tui",
246246
"state_dir": Path("./pitaya_state"),
247247
"logs_dir": Path("./logs"),
248-
"debug": False,
248+
# Debug mode removed; logs are verbose by default
249249
# Normative defaults per spec §6.1.1 (subset applied where supported)
250250
"import_policy": "auto", # auto|never|always
251251
"import_conflict_policy": "fail", # fail|overwrite|suffix

src/tui/cli.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ def create_parser(cls) -> argparse.ArgumentParser:
9292
"--event-types", nargs="+", help="Filter by event type(s)"
9393
)
9494

95-
# Diagnostics
96-
g_diag = parser.add_argument_group("Diagnostics")
97-
g_diag.add_argument("--debug", action="store_true", help="Enable debug logging")
95+
# Diagnostics (debug mode removed; verbose by default)
9896

9997
return parser
10098

@@ -137,8 +135,7 @@ async def run(self, args: argparse.Namespace) -> int:
137135
return 2
138136
except (OSError, IOError) as e:
139137
self.console.print(f"[red]Error: {e}[/red]")
140-
if args.debug:
141-
self.console.print_exception()
138+
self.console.print_exception()
142139
return 1
143140

144141
# Connected modes removed

0 commit comments

Comments
 (0)