Refactor settings management to use ~/.claude-mem/settings.json

- Updated paths in troubleshooting documentation to reflect new settings file location.
- Modified diagnostics and reference files to read from ~/.claude-mem/settings.json.
- Introduced getWorkerPort utility for cleaner worker port retrieval.
- Enhanced ChromaSync and SDKAgent to load Python version and Claude path from settings.
- Updated SettingsRoutes to validate new settings: CLAUDE_MEM_LOG_LEVEL and CLAUDE_MEM_PYTHON_VERSION.
- Added early-settings module to load settings for logger and other early-stage modules.
- Adjusted logger to use early-loaded log level setting.
- Refactored paths to utilize early-loaded data directory setting.
This commit is contained in:
Alex Newman
2025-12-09 12:23:33 -05:00
parent b22adcca05
commit fc5c2d5e07
23 changed files with 342 additions and 166 deletions
+3 -1
View File
@@ -3,6 +3,8 @@
* Provides readable, traceable logging with correlation IDs and data flow tracking
*/
import { loadEarlySetting } from '../shared/early-settings.js';
export enum LogLevel {
DEBUG = 0,
INFO = 1,
@@ -26,7 +28,7 @@ class Logger {
constructor() {
// Parse log level from environment
const envLevel = process.env.CLAUDE_MEM_LOG_LEVEL?.toUpperCase() || 'INFO';
const envLevel = loadEarlySetting('CLAUDE_MEM_LOG_LEVEL', 'INFO').toUpperCase();
this.level = LogLevel[envLevel as keyof typeof LogLevel] ?? LogLevel.INFO;
// Disable colors when output is not a TTY (e.g., PM2 logs)