From 55defb645c8b64e7dea2bb7f60fcc09d2135fbc0 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sat, 18 Oct 2025 22:25:02 +0200 Subject: [PATCH] debug: prefix all nostrverse logs with [NOSTRVERSE] - Makes it easy to filter console logs - Updated logs in nostrverseService.ts and Explore.tsx - All relevant logs now have consistent prefix --- src/components/Explore.tsx | 8 ++++---- src/services/nostrverseService.ts | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Explore.tsx b/src/components/Explore.tsx index 43d7b640..11a15c7c 100644 --- a/src/components/Explore.tsx +++ b/src/components/Explore.tsx @@ -246,14 +246,14 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti }) // Merge and deduplicate all highlights (mine from controller + friends + nostrverse) - console.log('📊 Highlight counts - mine:', myHighlights.length, 'friends:', friendsHighlights.length, 'nostrverse:', nostriverseHighlights.length) + console.log('[NOSTRVERSE] 📊 Highlight counts - mine:', myHighlights.length, 'friends:', friendsHighlights.length, 'nostrverse:', nostriverseHighlights.length) const allHighlights = [...myHighlights, ...friendsHighlights, ...nostriverseHighlights] const highlightsByKey = new Map() for (const highlight of allHighlights) { highlightsByKey.set(highlight.id, highlight) } const uniqueHighlights = Array.from(highlightsByKey.values()).sort((a, b) => b.created_at - a.created_at) - console.log('📊 Total unique highlights after merge:', uniqueHighlights.length) + console.log('[NOSTRVERSE] 📊 Total unique highlights after merge:', uniqueHighlights.length) // Fetch profiles for all blog post authors to cache them if (uniquePosts.length > 0) { @@ -310,7 +310,7 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti const classified = classifyHighlights(highlights, activeAccount?.pubkey, followedPubkeys) const levelCounts = { mine: 0, friends: 0, nostrverse: 0 } classified.forEach(h => levelCounts[h.level]++) - console.log('📊 Classified highlights by level:', levelCounts, 'visibility:', visibility) + console.log('[NOSTRVERSE] 📊 Classified highlights by level:', levelCounts, 'visibility:', visibility) const filtered = classified.filter(h => { if (h.level === 'mine' && !visibility.mine) return false @@ -318,7 +318,7 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti if (h.level === 'nostrverse' && !visibility.nostrverse) return false return true }) - console.log('📊 After visibility filter:', filtered.length, 'highlights') + console.log('[NOSTRVERSE] 📊 After visibility filter:', filtered.length, 'highlights') return filtered }, [highlights, activeAccount?.pubkey, followedPubkeys, visibility]) diff --git a/src/services/nostrverseService.ts b/src/services/nostrverseService.ts index 44933452..c1e98841 100644 --- a/src/services/nostrverseService.ts +++ b/src/services/nostrverseService.ts @@ -23,7 +23,7 @@ export const fetchNostrverseBlogPosts = async ( eventStore?: IEventStore ): Promise => { try { - console.log('📚 Fetching nostrverse blog posts (kind 30023), limit:', limit) + console.log('[NOSTRVERSE] 📚 Fetching blog posts (kind 30023), limit:', limit) // Deduplicate replaceable events by keeping the most recent version const uniqueEvents = new Map() @@ -49,7 +49,7 @@ export const fetchNostrverseBlogPosts = async ( } ) - console.log('📊 Nostrverse blog post events fetched (unique):', uniqueEvents.size) + console.log('[NOSTRVERSE] 📊 Blog post events fetched (unique):', uniqueEvents.size) // Convert to blog post previews and sort by published date (most recent first) const blogPosts: BlogPostPreview[] = Array.from(uniqueEvents.values()) @@ -67,7 +67,7 @@ export const fetchNostrverseBlogPosts = async ( return timeB - timeA // Most recent first }) - console.log('📰 Processed', blogPosts.length, 'unique nostrverse blog posts') + console.log('[NOSTRVERSE] 📰 Processed', blogPosts.length, 'unique blog posts') return blogPosts } catch (error) { @@ -89,7 +89,7 @@ export const fetchNostrverseHighlights = async ( eventStore?: IEventStore ): Promise => { try { - console.log('💡 Fetching nostrverse highlights (kind 9802), limit:', limit) + console.log('[NOSTRVERSE] 💡 Fetching highlights (kind 9802), limit:', limit) const seenIds = new Set() const rawEvents = await queryEvents( @@ -116,7 +116,7 @@ export const fetchNostrverseHighlights = async ( const uniqueEvents = dedupeHighlights(rawEvents) const highlights = uniqueEvents.map(eventToHighlight) - console.log('💡 Processed', highlights.length, 'unique nostrverse highlights') + console.log('[NOSTRVERSE] 💡 Processed', highlights.length, 'unique highlights') return sortHighlights(highlights) } catch (error) {