mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
feat: implement structured logging across server components
- Integrated a centralized logging system using createLogger from @automaker/utils, replacing console.log and console.error statements with logger methods for consistent log formatting and improved readability. - Updated various modules, including auth, events, and services, to utilize the new logging system, enhancing error tracking and operational visibility. - Refactored logging messages to provide clearer context and information, ensuring better maintainability and debugging capabilities. This update significantly enhances the observability of the server components, facilitating easier troubleshooting and monitoring.
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
* Common utilities for MCP routes
|
||||
*/
|
||||
|
||||
import { createLogger } from '@automaker/utils';
|
||||
|
||||
const logger = createLogger('MCP');
|
||||
|
||||
/**
|
||||
* Extract error message from unknown error
|
||||
*/
|
||||
@@ -16,5 +20,5 @@ export function getErrorMessage(error: unknown): string {
|
||||
* Log error with prefix
|
||||
*/
|
||||
export function logError(error: unknown, message: string): void {
|
||||
console.error(`[MCP] ${message}:`, error);
|
||||
logger.error(`${message}:`, error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user