From 52b1e8ffa35dec948a9939a7eeaf5c9461cb5d88 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 5 Sep 2025 19:52:53 -0600 Subject: [PATCH] chore: move more logger infos to debugs --- src/components/GiftedDialog.vue | 2 +- src/main.capacitor.ts | 11 ++++------- src/main.ts | 6 +++--- src/router/index.ts | 2 +- src/utils/PlatformServiceMixin.ts | 14 +++++++------- src/views/ContactQRScanFullView.vue | 18 +++++++++--------- src/views/ContactQRScanShowView.vue | 22 +++++++++++----------- src/views/ContactsView.vue | 8 ++++---- src/views/DatabaseMigration.vue | 8 ++++---- src/views/HomeView.vue | 16 ++++++++-------- src/views/SearchAreaView.vue | 6 +++--- 11 files changed, 55 insertions(+), 58 deletions(-) diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 93d614d5..9561fbc6 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -227,7 +227,7 @@ export default class GiftedDialog extends Vue { const activeIdentity = await (this as any).$getActiveIdentity(); this.activeDid = activeIdentity.activeDid || ""; - logger.info("[GiftedDialog] Settings received:", { + logger.debug("[GiftedDialog] Settings received:", { activeDid: this.activeDid, apiServer: this.apiServer, }); diff --git a/src/main.capacitor.ts b/src/main.capacitor.ts index c97efce8..f091770b 100644 --- a/src/main.capacitor.ts +++ b/src/main.capacitor.ts @@ -115,25 +115,25 @@ const registerDeepLinkListener = async () => { ); // Check if Capacitor App plugin is available - logger.info(`[Main] ๐Ÿ” Checking Capacitor App plugin availability...`); + logger.debug(`[Main] ๐Ÿ” Checking Capacitor App plugin availability...`); if (!CapacitorApp) { throw new Error("Capacitor App plugin not available"); } logger.info(`[Main] โœ… Capacitor App plugin is available`); // Check available methods on CapacitorApp - logger.info( + logger.debug( `[Main] ๐Ÿ” Capacitor App plugin methods:`, Object.getOwnPropertyNames(CapacitorApp), ); - logger.info( + logger.debug( `[Main] ๐Ÿ” Capacitor App plugin addListener method:`, typeof CapacitorApp.addListener, ); // Wait for router to be ready first await router.isReady(); - logger.info( + logger.debug( `[Main] โœ… Router is ready, proceeding with listener registration`, ); @@ -148,9 +148,6 @@ const registerDeepLinkListener = async () => { listenerHandle, ); - // Test the listener registration by checking if it's actually registered - logger.info(`[Main] ๐Ÿงช Verifying listener registration...`); - return listenerHandle; } catch (error) { logger.error(`[Main] โŒ Failed to register deeplink listener:`, { diff --git a/src/main.ts b/src/main.ts index cc05e386..bbdbd09e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,12 +24,12 @@ logger.info("[Main] ๐ŸŒ Boot-time environment configuration:", { // Dynamically import the appropriate main entry point if (platform === "capacitor") { - logger.info(`[Main] ๐Ÿ“ฑ Loading Capacitor-specific entry point`); + logger.debug(`[Main] ๐Ÿ“ฑ Loading Capacitor-specific entry point`); import("./main.capacitor"); } else if (platform === "electron") { - logger.info(`[Main] ๐Ÿ’ป Loading Electron-specific entry point`); + logger.debug(`[Main] ๐Ÿ’ป Loading Electron-specific entry point`); import("./main.electron"); } else { - logger.info(`[Main] ๐ŸŒ Loading Web-specific entry point`); + logger.debug(`[Main] ๐ŸŒ Loading Web-specific entry point`); import("./main.web"); } diff --git a/src/router/index.ts b/src/router/index.ts index cf450c37..584f7403 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -387,7 +387,7 @@ router.beforeEach(async (to, _from, next) => { ); } - logger.info(`[Router] โœ… Navigation guard passed for: ${to.path}`); + logger.debug(`[Router] โœ… Navigation guard passed for: ${to.path}`); next(); } catch (error) { logger.error("[Router] โŒ Identity creation failed in navigation guard:", { diff --git a/src/utils/PlatformServiceMixin.ts b/src/utils/PlatformServiceMixin.ts index 0e9bebec..0dd58f48 100644 --- a/src/utils/PlatformServiceMixin.ts +++ b/src/utils/PlatformServiceMixin.ts @@ -640,7 +640,7 @@ export const PlatformServiceMixin = { */ async $getActiveIdentity(): Promise<{ activeDid: string }> { try { - logger.info( + logger.debug( "[PlatformServiceMixin] $getActiveIdentity() called - API layer verification", ); @@ -656,7 +656,7 @@ export const PlatformServiceMixin = { logger.debug("[PlatformServiceMixin] Active identity found:", { activeDid, }); - logger.info( + logger.debug( "[PlatformServiceMixin] $getActiveIdentity(): activeDid resolved", { activeDid }, ); @@ -701,7 +701,7 @@ export const PlatformServiceMixin = { const accountDids = availableAccounts.values.map( (row: unknown[]) => row[0] as string, ); - logger.info( + logger.debug( "[PlatformServiceMixin] Available accounts for user selection:", { accountDids }, ); @@ -987,7 +987,7 @@ export const PlatformServiceMixin = { "[PlatformServiceMixin] Using activeDid from active_identity table:", { activeDid: activeIdentity.activeDid }, ); - logger.info( + logger.debug( "[PlatformServiceMixin] $accountSettings() returning activeDid:", { activeDid: mergedSettings.activeDid }, ); @@ -1766,7 +1766,7 @@ export const PlatformServiceMixin = { const settings = mappedResults[0] as Settings; - logger.info(`[PlatformServiceMixin] Settings for DID ${did}:`, { + logger.debug(`[PlatformServiceMixin] Settings for DID ${did}:`, { firstName: settings.firstName, isRegistered: settings.isRegistered, activeDid: settings.activeDid, @@ -1793,7 +1793,7 @@ export const PlatformServiceMixin = { try { // Get default settings const defaultSettings = await this.$getMasterSettings({}); - logger.info( + logger.debug( `[PlatformServiceMixin] Default settings:`, defaultSettings, ); @@ -1807,7 +1807,7 @@ export const PlatformServiceMixin = { defaultSettings || {}, ); - logger.info(`[PlatformServiceMixin] Merged settings for ${did}:`, { + logger.debug(`[PlatformServiceMixin] Merged settings for ${did}:`, { defaultSettings, didSettings, mergedSettings, diff --git a/src/views/ContactQRScanFullView.vue b/src/views/ContactQRScanFullView.vue index 4364ec49..32814499 100644 --- a/src/views/ContactQRScanFullView.vue +++ b/src/views/ContactQRScanFullView.vue @@ -394,7 +394,7 @@ export default class ContactQRScanFull extends Vue { this.isCleaningUp = true; try { - logger.info("Cleaning up QR scanner resources"); + logger.debug("Cleaning up QR scanner resources"); await this.stopScanning(); await QRScannerFactory.cleanup(); } catch (error) { @@ -428,7 +428,7 @@ export default class ContactQRScanFull extends Vue { rawValue === this.lastScannedValue && now - this.lastScanTime < this.SCAN_DEBOUNCE_MS ) { - logger.info("Ignoring duplicate scan:", rawValue); + logger.debug("Ignoring duplicate scan:", rawValue); return; } @@ -436,7 +436,7 @@ export default class ContactQRScanFull extends Vue { this.lastScannedValue = rawValue; this.lastScanTime = now; - logger.info("Processing QR code scan result:", rawValue); + logger.debug("Processing QR code scan result:", rawValue); let contact: Contact; if (rawValue.includes(CONTACT_IMPORT_CONFIRM_URL_PATH_TIME_SAFARI)) { @@ -449,7 +449,7 @@ export default class ContactQRScanFull extends Vue { } // Process JWT and contact info - logger.info("Decoding JWT payload from QR code"); + logger.debug("Decoding JWT payload from QR code"); const decodedJwt = await decodeEndorserJwt(jwt); if (!decodedJwt?.payload?.own) { logger.warn("Invalid JWT payload - missing 'own' field"); @@ -488,7 +488,7 @@ export default class ContactQRScanFull extends Vue { } // Add contact but keep scanning - logger.info("Adding new contact to database:", { + logger.debug("Adding new contact to database:", { did: contact.did, name: contact.name, }); @@ -547,7 +547,7 @@ export default class ContactQRScanFull extends Vue { */ async addNewContact(contact: Contact) { try { - logger.info("Opening database connection for new contact"); + logger.debug("Opening database connection for new contact"); // Check if contact already exists const existingContact = await this.$getContact(contact.did); @@ -561,7 +561,7 @@ export default class ContactQRScanFull extends Vue { await this.$insertContact(contact); if (this.activeDid) { - logger.info("Setting contact visibility", { did: contact.did }); + logger.debug("Setting contact visibility", { did: contact.did }); await this.setVisibility(contact, true); contact.seesMe = true; } @@ -608,7 +608,7 @@ export default class ContactQRScanFull extends Vue { async handleAppPause() { if (!this.isMounted) return; - logger.info("App paused, stopping scanner"); + logger.debug("App paused, stopping scanner"); await this.stopScanning(); } @@ -618,7 +618,7 @@ export default class ContactQRScanFull extends Vue { handleAppResume() { if (!this.isMounted) return; - logger.info("App resumed, scanner can be restarted by user"); + logger.debug("App resumed, scanner can be restarted by user"); this.isScanning = false; } diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index 11a438e3..bbfe1af4 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -422,7 +422,7 @@ export default class ContactQRScanShow extends Vue { this.isCleaningUp = true; try { - logger.info("Cleaning up QR scanner resources"); + logger.debug("Cleaning up QR scanner resources"); await this.stopScanning(); await QRScannerFactory.cleanup(); } catch (error) { @@ -456,7 +456,7 @@ export default class ContactQRScanShow extends Vue { rawValue === this.lastScannedValue && now - this.lastScanTime < this.SCAN_DEBOUNCE_MS ) { - logger.info("Ignoring duplicate scan:", rawValue); + logger.debug("Ignoring duplicate scan:", rawValue); return; } @@ -464,7 +464,7 @@ export default class ContactQRScanShow extends Vue { this.lastScannedValue = rawValue; this.lastScanTime = now; - logger.info("Processing QR code scan result:", rawValue); + logger.debug("Processing QR code scan result:", rawValue); let contact: Contact; if (rawValue.includes(CONTACT_IMPORT_CONFIRM_URL_PATH_TIME_SAFARI)) { @@ -474,7 +474,7 @@ export default class ContactQRScanShow extends Vue { this.notify.error(NOTIFY_QR_INVALID_QR_CODE.message); return; } - logger.info("Decoding JWT payload from QR code"); + logger.debug("Decoding JWT payload from QR code"); const decodedJwt = await decodeEndorserJwt(jwt); // Process JWT and contact info @@ -509,7 +509,7 @@ export default class ContactQRScanShow extends Vue { } // Add contact but keep scanning - logger.info("Adding new contact to database:", { + logger.debug("Adding new contact to database:", { did: contact.did, name: contact.name, }); @@ -543,7 +543,7 @@ export default class ContactQRScanShow extends Vue { } async register(contact: Contact) { - logger.info("Submitting contact registration", { + logger.debug("Submitting contact registration", { did: contact.did, name: contact.name, }); @@ -559,7 +559,7 @@ export default class ContactQRScanShow extends Vue { if (regResult.success) { contact.registered = true; await this.$updateContact(contact.did, { registered: true }); - logger.info("Contact registration successful", { did: contact.did }); + logger.debug("Contact registration successful", { did: contact.did }); this.notify.success( createQRRegistrationSuccessMessage(contact.name || ""), @@ -687,20 +687,20 @@ export default class ContactQRScanShow extends Vue { async handleAppPause() { if (!this.isMounted) return; - logger.info("App paused, stopping scanner"); + logger.debug("App paused, stopping scanner"); await this.stopScanning(); } handleAppResume() { if (!this.isMounted) return; - logger.info("App resumed, scanner can be restarted by user"); + logger.debug("App resumed, scanner can be restarted by user"); this.isScanning = false; } async addNewContact(contact: Contact) { try { - logger.info("Opening database connection for new contact"); + logger.debug("Opening database connection for new contact"); // Check if contact already exists const existingContact = await this.$getContact(contact.did); @@ -727,7 +727,7 @@ export default class ContactQRScanShow extends Vue { await this.$insertContact(contact); if (this.activeDid) { - logger.info("Setting contact visibility", { did: contact.did }); + logger.debug("Setting contact visibility", { did: contact.did }); await this.setVisibility(contact, true); contact.seesMe = true; } diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 2496c66e..23d4fbe9 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -301,7 +301,7 @@ export default class ContactsView extends Vue { this.apiServer = settings.apiServer || DEFAULT_ENDORSER_API_SERVER; this.isRegistered = !!settings.isRegistered; - logger.info("[ContactsView] Created with settings:", { + logger.debug("[ContactsView] Created with settings:", { activeDid: this.activeDid, apiServer: this.apiServer, isRegistered: this.isRegistered, @@ -355,7 +355,7 @@ export default class ContactsView extends Vue { // this happens when a platform (eg iOS) doesn't include anything after the "=" in a shared link. this.notify.error(NOTIFY_BLANK_INVITE.message, TIMEOUTS.VERY_LONG); } else if (importedInviteJwt) { - logger.info("[ContactsView] Processing invite JWT, current activeDid:", { + logger.debug("[ContactsView] Processing invite JWT, current activeDid:", { activeDid: this.activeDid, }); @@ -376,7 +376,7 @@ export default class ContactsView extends Vue { } // send invite directly to server, with auth for this user const headers = await getHeaders(this.activeDid); - logger.info("[ContactsView] Making API request to claim invite:", { + logger.debug("[ContactsView] Making API request to claim invite:", { apiServer: this.apiServer, activeDid: this.activeDid, hasApiServer: !!this.apiServer, @@ -404,7 +404,7 @@ export default class ContactsView extends Vue { const payload: JWTPayload = decodeEndorserJwt(importedInviteJwt).payload; const registration = payload as VerifiableCredential; - logger.info( + logger.debug( "[ContactsView] Opening ContactNameDialog for invite processing", ); (this.$refs.contactNameDialog as ContactNameDialog).open( diff --git a/src/views/DatabaseMigration.vue b/src/views/DatabaseMigration.vue index ec5e2eef..4610b3d2 100644 --- a/src/views/DatabaseMigration.vue +++ b/src/views/DatabaseMigration.vue @@ -1265,7 +1265,7 @@ export default class DatabaseMigration extends Vue { this.comparison.differences.settings.added.length + this.comparison.differences.accounts.added.length; this.successMessage = `Comparison completed successfully. Found ${totalItems} items to migrate.`; - logger.info( + logger.debug( "[DatabaseMigration] Database comparison completed successfully", ); } catch (error) { @@ -1317,7 +1317,7 @@ export default class DatabaseMigration extends Vue { this.successMessage += ` ${result.warnings.length} warnings.`; this.warning += result.warnings.join(", "); } - logger.info( + logger.debug( "[DatabaseMigration] Settings migration completed successfully", result, ); @@ -1360,7 +1360,7 @@ export default class DatabaseMigration extends Vue { this.successMessage += ` ${result.warnings.length} warnings.`; this.warning += result.warnings.join(", "); } - logger.info( + logger.debug( "[DatabaseMigration] Account migration completed successfully", result, ); @@ -1410,7 +1410,7 @@ export default class DatabaseMigration extends Vue { URL.revokeObjectURL(url); this.successMessage = "Comparison data exported successfully"; - logger.info("[DatabaseMigration] Comparison data exported successfully"); + logger.debug("[DatabaseMigration] Comparison data exported successfully"); } catch (error) { this.error = `Failed to export comparison data: ${error}`; logger.error("[DatabaseMigration] Export failed:", error); diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 45dbfea8..9374d079 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -471,7 +471,7 @@ export default class HomeView extends Vue { */ async mounted() { try { - logger.info("[HomeView] mounted() - component lifecycle started", { + logger.debug("[HomeView] mounted() - component lifecycle started", { timestamp: new Date().toISOString(), componentName: "HomeView", }); @@ -482,7 +482,7 @@ export default class HomeView extends Vue { // Registration check already handled in initializeIdentity() await this.loadFeedData(); - logger.info("[HomeView] mounted() - about to call loadNewOffers()", { + logger.debug("[HomeView] mounted() - about to call loadNewOffers()", { timestamp: new Date().toISOString(), activeDid: this.activeDid, hasActiveDid: !!this.activeDid, @@ -490,7 +490,7 @@ export default class HomeView extends Vue { await this.loadNewOffers(); - logger.info("[HomeView] mounted() - loadNewOffers() completed", { + logger.debug("[HomeView] mounted() - loadNewOffers() completed", { timestamp: new Date().toISOString(), numNewOffersToUser: this.numNewOffersToUser, numNewOffersToUserProjects: this.numNewOffersToUserProjects, @@ -500,7 +500,7 @@ export default class HomeView extends Vue { await this.checkOnboarding(); - logger.info("[HomeView] mounted() - component lifecycle completed", { + logger.debug("[HomeView] mounted() - component lifecycle completed", { timestamp: new Date().toISOString(), finalState: { numNewOffersToUser: this.numNewOffersToUser, @@ -589,7 +589,7 @@ export default class HomeView extends Vue { // eslint-disable-next-line @typescript-eslint/no-explicit-any const activeIdentity = await (this as any).$getActiveIdentity(); this.activeDid = activeIdentity.activeDid || ""; - logger.info("[HomeView] ActiveDid migration - using new API", { + logger.debug("[HomeView] ActiveDid migration - using new API", { activeDid: this.activeDid, source: "active_identity table", hasActiveDid: !!this.activeDid, @@ -735,7 +735,7 @@ export default class HomeView extends Vue { * @requires Active DID */ private async loadNewOffers() { - logger.info("[HomeView] loadNewOffers() called with activeDid:", { + logger.debug("[HomeView] loadNewOffers() called with activeDid:", { activeDid: this.activeDid, hasActiveDid: !!this.activeDid, length: this.activeDid?.length || 0, @@ -759,7 +759,7 @@ export default class HomeView extends Vue { this.activeDid, this.lastAckedOfferToUserJwtId, ); - logger.info( + logger.debug( "[HomeView] loadNewOffers() - getNewOffersToUser successful", { activeDid: this.activeDid, @@ -785,7 +785,7 @@ export default class HomeView extends Vue { this.activeDid, this.lastAckedOfferToUserProjectsJwtId, ); - logger.info( + logger.debug( "[HomeView] loadNewOffers() - getNewOffersToUserProjects successful", { activeDid: this.activeDid, diff --git a/src/views/SearchAreaView.vue b/src/views/SearchAreaView.vue index abbc9f94..7efcf48d 100644 --- a/src/views/SearchAreaView.vue +++ b/src/views/SearchAreaView.vue @@ -206,7 +206,7 @@ export default class SearchAreaView extends Vue { this.searchBox = settings.searchBoxes?.[0] || null; this.resetLatLong(); - logger.info("[SearchAreaView] Component mounted", { + logger.debug("[SearchAreaView] Component mounted", { hasStoredSearchBox: !!this.searchBox, searchBoxName: this.searchBox?.name, coordinates: this.searchBox?.bbox, @@ -317,7 +317,7 @@ export default class SearchAreaView extends Vue { this.searchBox = newSearchBox; this.isChoosingSearchBox = false; - logger.info("[SearchAreaView] Search box stored successfully", { + logger.debug("[SearchAreaView] Search box stored successfully", { searchBox: newSearchBox, coordinates: newSearchBox.bbox, }); @@ -360,7 +360,7 @@ export default class SearchAreaView extends Vue { this.isChoosingSearchBox = false; this.isNewMarkerSet = false; - logger.info("[SearchAreaView] Search box deleted successfully"); + logger.debug("[SearchAreaView] Search box deleted successfully"); // Enhanced notification system with proper timeout this.notify?.success(NOTIFY_SEARCH_AREA_DELETED.text, TIMEOUTS.STANDARD);