Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
d96cb36
1
Parent(s): 6077e12
fix: Define LOGS_DIR before use to resolve NameError
Browse filesAdd path constants (BASE_DIR, DATA_DIR, LOGS_DIR) immediately after
imports and before logging configuration. LOGS_DIR was being used
without definition, causing runtime crash on line 29.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -24,6 +24,12 @@ from dataclasses import dataclass, asdict
|
|
| 24 |
from enum import Enum
|
| 25 |
import logging
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
# ========== Logging Configuration ==========
|
| 28 |
# Configure logging early to capture all events
|
| 29 |
LOGS_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 24 |
from enum import Enum
|
| 25 |
import logging
|
| 26 |
|
| 27 |
+
# ========== Path Constants ==========
|
| 28 |
+
BASE_DIR = Path(__file__).resolve().parent
|
| 29 |
+
DATA_DIR = BASE_DIR / ".openclaw" / "logs"
|
| 30 |
+
LOGS_DIR = DATA_DIR
|
| 31 |
+
LOGS_DIR.mkdir(parents=True, exist_ok=True)
|
| 32 |
+
|
| 33 |
# ========== Logging Configuration ==========
|
| 34 |
# Configure logging early to capture all events
|
| 35 |
LOGS_DIR.mkdir(parents=True, exist_ok=True)
|