Skip to main content
Glama
logger.js1.5 kB
/** * logger.js - Standardized logging utility for the Task Manager * * This module ensures all logs are directed to the appropriate output streams: * - All debug/info/warn/error messages go to stderr * - Only actual command output (data meant for piping) goes to stdout */ /** * Log a debug message to stderr * @param {string} message - The message to log */ function debug(message) { console.error(`[DEBUG] ${message}`); } /** * Log an info message to stderr * @param {string} message - The message to log */ function info(message) { console.error(`[INFO] ${message}`); } /** * Log a warning message to stderr * @param {string} message - The message to log */ function warn(message) { console.error(`[WARN] ${message}`); } /** * Log an error message to stderr * @param {string} message - The message to log */ function error(message) { console.error(`[ERROR] ${message}`); } /** * Output data to stdout (for command results) * This is the only function that should write to stdout * @param {string|object} data - The data to output */ function output(data) { if (typeof data === 'object') { console.log(JSON.stringify(data, null, 2)); } else { console.log(data); } } /** * Output a table to stdout using the provided table object * @param {Table} table - The cli-table3 table object to output */ function outputTable(table) { console.log(table.toString()); } module.exports = { debug, info, warn, error, output, outputTable };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FutureAtoms/agentic-control-framework'

If you have feedback or need assistance with the MCP directory API, please join our Discord server