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
This commit is contained in:
Gigi
2025-10-18 22:25:02 +02:00
parent 1ba9595542
commit 55defb645c
2 changed files with 9 additions and 9 deletions

View File

@@ -246,14 +246,14 @@ const Explore: React.FC<ExploreProps> = ({ 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<string, Highlight>()
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<ExploreProps> = ({ 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<ExploreProps> = ({ 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])

View File

@@ -23,7 +23,7 @@ export const fetchNostrverseBlogPosts = async (
eventStore?: IEventStore
): Promise<BlogPostPreview[]> => {
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<string, NostrEvent>()
@@ -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<Highlight[]> => {
try {
console.log('💡 Fetching nostrverse highlights (kind 9802), limit:', limit)
console.log('[NOSTRVERSE] 💡 Fetching highlights (kind 9802), limit:', limit)
const seenIds = new Set<string>()
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) {