feat(logging): enhance debug logging across app

Improves application logging and error tracking:
- Add structured logging in main.common.ts for app initialization
- Enhance API error handling with detailed context in services
- Add deep link debugging in Capacitor platform
- Improve plan service logging with retry information
- Update endorser server logs for better cache debugging

Technical changes:
- Replace console.error with info for non-critical cache misses
- Add component context to global error handler
- Add detailed logging for plan loading and retries
- Improve deep link route matching logs
- Add mount state logging for Capacitor

This improves debugging capabilities across web and mobile platforms.
This commit is contained in:
Matthew Raymer
2025-02-20 10:36:47 +00:00
parent 1e22cdec82
commit b5b5d45b99
7 changed files with 138 additions and 57 deletions

View File

@@ -1,6 +1,15 @@
export const handleApiError = (error: any, endpoint: string) => {
if (process.env.VITE_PLATFORM === 'capacitor') {
console.error(`[Capacitor API Error] ${endpoint}:`, error);
console.error(`[Capacitor API Error] ${endpoint}:`, {
message: error.message,
status: error.response?.status,
data: error.response?.data,
config: {
url: error.config?.url,
method: error.config?.method,
headers: error.config?.headers
}
});
}
// Specific handling for rate limits