UNPKG

dokumetry

Version:

An NPM Package for tracking OpenAI API calls and sending usage metrics to Doku

13 lines (11 loc) 427 B
/** * Logs data on console with prefix `Dokumetry:` * * @param {Error} error - Error to be logged. */ export async function logError(error) { const APPLICATION_NAME = "Dokumetry"; const formattedError = "\x1b[31m" + error + "\x1b[0m"; // Red color for error const formattedAppName = "\x1b[34m" + APPLICATION_NAME + "\x1b[0m"; // Blue color for application name console.log(formattedAppName + ": " + formattedError); }