|
@@ -86,9 +86,9 @@ class ConsoleLogger {
|
|
|
|
|
|
const formattedCategory = categoryStyle(`[${category}]`);
|
|
|
const formattedClassName = categoryStyle(`${this.className}`);
|
|
|
- const formattedLocation = locationStyle(`${location}`);
|
|
|
+ const formattedLocation = locationStyle(` ${location}`);
|
|
|
|
|
|
- const formattedMessage = `${formattedClassName} ${formattedLocation}: ${message.message}`;
|
|
|
+ const formattedMessage = `${formattedClassName}${formattedLocation}: ${message.message}`;
|
|
|
console.log(formattedMessage, message.details ? applyColor([255, 255, 97])(message.details) : '');
|
|
|
|
|
|
if (message.details && this.isCategoryEnabled(["details"])) {
|
|
@@ -156,37 +156,3 @@ class ConsoleLogger {
|
|
|
|
|
|
export default ConsoleLogger;
|
|
|
|
|
|
-
|
|
|
-// Extract file name and line number using regex
|
|
|
-// const match = callerLine?.match(/\((.*):(\d+):(\d+)\)/);
|
|
|
-// if (match) {
|
|
|
-// const [_, filePath, line, column] = match;
|
|
|
-// return `${filePath}:${line}:${column}`;
|
|
|
-// }
|
|
|
-
|
|
|
-// log(message: { message: string, details?: any }): void {
|
|
|
-// if (!this.isCategoryEnabled(this.categoryPath)) {
|
|
|
-// return; // Skip logging if the category is disabled
|
|
|
-// }
|
|
|
-// const category = this.categoryPath.join(" -> ").toUpperCase();
|
|
|
-// const location = this.getLogLocation();
|
|
|
-
|
|
|
-// // Map the primary category to a color
|
|
|
-// const primaryCategory = this.categoryPath[0];
|
|
|
-// const categoryStyle = logColors[primaryCategory] || ((text: string) => text); // Default to no style if not found
|
|
|
-// const formattedCategory = categoryStyle(`[${category}]`); // Apply color to category part
|
|
|
-
|
|
|
-// // Apply the same color to the className
|
|
|
-// const formattedClassName = categoryStyle(`${this.className}`);
|
|
|
-
|
|
|
-// // Format the message
|
|
|
-// const formattedLocation = logColors.location(`${location}`); // Apply color to location part
|
|
|
-// const formattedMessage = `${formattedClassName} ${formattedLocation}: ${message.message}`;
|
|
|
-
|
|
|
-// // Log based on whether it's an error or regular log
|
|
|
-// console.log(formattedMessage, message.details ? logColors.details(message.details) : '');
|
|
|
-// // Log details if enabled
|
|
|
-// if (message.details && this.isCategoryEnabled(["details"])) {
|
|
|
-// console.log(logColors.details('Details: '), message.details);
|
|
|
-// }
|
|
|
-// }
|