Goal
Replace all console.log and console.error usages in the repository with a custom logger that supports configurable log levels (debug, info, warn, error). Users should be able to set the log verbosity during agent/builder instantiation at runtime. The logger should default to 'warn' and 'error' only, and be exposed to the object instance for further logging. No third-party logging libraries should be used.
Requirements
- Create a simple logger utility (no dependencies) with log levels: debug, info, warn, error.
- Provide a way for users to configure the log level at runtime via the builder/agent constructor (default: 'warn' and 'error' only).
- Expose the logger instance on object instantiation for custom user logging.
- Replace all direct usages of
console.log and console.error in Core and Tools modules with the new logger.
- Prioritize updates to the
core/ and core/tools/ directories.
Code Pointers
Below are relevant code locations where logging is currently used and should be updated:
Core
Tools
Example (for documentation update, less critical)
Acceptance Criteria
- All direct console logging in prioritized modules is replaced by the custom logger.
- Log level can be configured at runtime, defaults to 'warn'/'error'.
- Logger instance is exposed for user access.
- No third-party logger libraries used.
Example logger usage
const logger = new Logger({ level: 'info' });
logger.debug('message');
logger.warn('warn message');
// ...
References
This issue is a feature request to improve developer experience and production readiness by standardizing and controlling logging output.
Goal
Replace all
console.logandconsole.errorusages in the repository with a custom logger that supports configurable log levels (debug, info, warn, error). Users should be able to set the log verbosity during agent/builder instantiation at runtime. The logger should default to 'warn' and 'error' only, and be exposed to the object instance for further logging. No third-party logging libraries should be used.Requirements
console.logandconsole.errorin Core and Tools modules with the new logger.core/andcore/tools/directories.Code Pointers
Below are relevant code locations where logging is currently used and should be updated:
Core
core/llm.ts: Logging tool execution success and errorscore/BaseAgent.ts: Static logExecution methodcore/toolkit.ts: Error logging insidecreateAgentToolcore/mcp/client.ts: Logging discovered tools and errorsTools
core/tools/registry.ts: Registering and auto-registering toolscore/tools/index.ts: Registering default toolscore/tools/ragSearch.ts: Error logging in RAG searchExample (for documentation update, less critical)
example/testMcpIntegration.ts: Logging in example scriptsAcceptance Criteria
Example logger usage
References
This issue is a feature request to improve developer experience and production readiness by standardizing and controlling logging output.