@@ -29,9 +29,11 @@ npm run build # Build producción (minificado)
2929```
3030src/
3131├── main.ts # Entry point, registra comandos y vistas
32- ├── settings.ts # PluginSettingTab con config (API key, modelo , etc.)
32+ ├── settings.ts # PluginSettingTab con config (API key, modo , etc.)
3333├── claude-client.ts # Wrapper Anthropic SDK con streaming
3434├── chat-view.ts # ItemView para panel lateral de chat
35+ ├── model-orchestrator.ts # Enrutador inteligente de modelos
36+ ├── logger.ts # Sistema de logging centralizado
3537├── note-creator.ts # Modal para crear notas desde chat
3638├── note-processor.ts # Procesamiento de notas existentes
3739├── vault-indexer.ts # Indexación de bóveda
4345├── vault-actions.ts # Ejecutor de acciones sobre bóveda
4446├── agent-mode.ts # Gestión del modo agente
4547├── confirmation-modal.ts # Modal de confirmación de acciones
48+ ├── context-manager.ts # Gestión de contexto de conversación
49+ ├── context-storage.ts # Almacenamiento temporal de contexto
4650├── i18n/ # Internationalization system
4751│ ├── index.ts # Public API (t, setLocale, etc.)
4852│ ├── types.ts # TypeScript types and translation keys
@@ -133,6 +137,45 @@ Example of adding German patterns:
133137/ ^ fortfahren$ / i , // German: "proceed"
134138```
135139
140+ ## Logging
141+
142+ ** CRITICAL: Never use ` console.log ` , ` console.warn ` , or ` console.error ` directly.**
143+
144+ All debug and error messages must use the centralized logger from ` src/logger.ts ` . This ensures:
145+ - Production builds only show warnings and errors (for user bug reports)
146+ - Development builds show all log levels for debugging
147+ - Consistent ` [Claudian] ` prefix across all messages
148+
149+ ``` typescript
150+ // ✅ Correct
151+ import { logger } from ' ./logger' ;
152+ logger .debug (' Orchestrator classified task as simple' );
153+ logger .info (' Context session initialized' );
154+ logger .warn (' Task classification failed, using fallback' );
155+ logger .error (' API Error:' , error );
156+
157+ // ❌ Wrong - direct console usage
158+ console .log (' [Claudian] Something happened' );
159+ console .error (' Error:' , error );
160+ ```
161+
162+ ** Log levels:**
163+
164+ | Level | Production | Development | Use For |
165+ | -------| ------------| -------------| ---------|
166+ | ` debug ` | Hidden | Visible | Detailed flow, variable values, orchestrator decisions |
167+ | ` info ` | Hidden | Visible | Lifecycle events, successful operations, state changes |
168+ | ` warn ` | Visible | Visible | Recoverable errors, fallbacks, deprecated usage |
169+ | ` error ` | Visible | Visible | Failures, exceptions, critical issues |
170+
171+ ** Guidelines:**
172+ - Use ` debug ` for information only developers need during development
173+ - Use ` info ` for notable events (migrations, session start/end)
174+ - Use ` warn ` for issues that don't break functionality but should be noted
175+ - Use ` error ` for failures that users might need to report
176+
177+ The ` __DEV__ ` constant is injected at build time by esbuild to determine the environment.
178+
136179## Documentation
137180
138181** CRITICAL: README.md must always be in English.**
0 commit comments