Browse Source

chore: move more logger infos to debugs

pull/188/head
Trent Larson 1 week ago
parent
commit
52b1e8ffa3
  1. 2
      src/components/GiftedDialog.vue
  2. 11
      src/main.capacitor.ts
  3. 6
      src/main.ts
  4. 2
      src/router/index.ts
  5. 14
      src/utils/PlatformServiceMixin.ts
  6. 18
      src/views/ContactQRScanFullView.vue
  7. 22
      src/views/ContactQRScanShowView.vue
  8. 8
      src/views/ContactsView.vue
  9. 8
      src/views/DatabaseMigration.vue
  10. 16
      src/views/HomeView.vue
  11. 6
      src/views/SearchAreaView.vue

2
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,
});

11
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:`, {

6
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");
}

2
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:", {

14
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,

18
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;
}

22
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;
}

8
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(

8
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);

16
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,

6
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);

Loading…
Cancel
Save