@traversets/code-extractor
Version:
The TypeScript Code Extractor and Analyzer can be handy for RAG (Retrieval-Augmented Generation) systems for codebases. It provides a detailed and structured representation of the codebase that can be converted into embeddings, enabling more effective adv
25 lines • 938 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.logError = exports.getLogger = void 0;
const logger_1 = require("../logger");
const getLogger = () => {
return new logger_1.ApplicationLogger();
};
exports.getLogger = getLogger;
/**
* Logs an error message with the provided context using the ApplicationLogger.
* @param {any} error - The error object to log.
* @param {string} methodName - The name of the method that encountered the error.
* @param {any} props - Additional properties to include in the log context.
*/
const logError = (error, methodName, props) => {
const logger = (0, exports.getLogger)();
const context = {
method: methodName,
props: JSON.stringify(props),
errorStack: error instanceof Error ? error.stack : undefined,
};
logger.error(context, error.message, error);
};
exports.logError = logError;
//# sourceMappingURL=utils.js.map
;