debug: add common prefix [profile-loading-debug] to all debug logs

All profile loading related debug logs now have the common prefix for easy filtering in console.
This commit is contained in:
Gigi
2025-11-02 22:40:08 +01:00
parent 3b2732681d
commit 27dde5afa2
6 changed files with 22 additions and 22 deletions

View File

@@ -46,14 +46,14 @@ const NostrMentionLink: React.FC<NostrMentionLinkProps> = ({
// Check cache
const cached = loadCachedProfiles([pubkey])
if (cached.has(pubkey)) {
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... in cache`)
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... in cache`)
return true
}
// Check eventStore
const eventStoreProfile = eventStore?.getEvent(pubkey + ':0')
const inStore = !!eventStoreProfile
if (inStore) {
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... in eventStore`)
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... in eventStore`)
}
return inStore
}, [pubkey, eventStore, nostrUri])
@@ -62,7 +62,7 @@ const NostrMentionLink: React.FC<NostrMentionLinkProps> = ({
const isLoading = !profile && pubkey && !isInCacheOrStore &&
decoded && (decoded.type === 'npub' || decoded.type === 'nprofile')
if (isLoading) {
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
}
// If decoding failed, show shortened identifier

View File

@@ -31,14 +31,14 @@ const ResolvedMention: React.FC<ResolvedMentionProps> = ({ encoded }) => {
// Check cache
const cached = loadCachedProfiles([pubkey])
if (cached.has(pubkey)) {
console.log(`[resolved-mention] ${encoded?.slice(0, 16)}... in cache`)
console.log(`[profile-loading-debug][resolved-mention] ${encoded?.slice(0, 16)}... in cache`)
return true
}
// Check eventStore
const eventStoreProfile = eventStore?.getEvent(pubkey + ':0')
const inStore = !!eventStoreProfile
if (inStore) {
console.log(`[resolved-mention] ${encoded?.slice(0, 16)}... in eventStore`)
console.log(`[profile-loading-debug][resolved-mention] ${encoded?.slice(0, 16)}... in eventStore`)
}
return inStore
}, [pubkey, eventStore, encoded])
@@ -46,7 +46,7 @@ const ResolvedMention: React.FC<ResolvedMentionProps> = ({ encoded }) => {
// Show loading if profile doesn't exist and not in cache/store
const isLoading = !profile && pubkey && !isInCacheOrStore
if (isLoading && encoded) {
console.log(`[resolved-mention] ${encoded.slice(0, 16)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
console.log(`[profile-loading-debug][resolved-mention] ${encoded.slice(0, 16)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
}
const display = pubkey ? getProfileDisplayName(profile, pubkey) : encoded