Skip to content

Commit

Permalink
[stream-metadata] remove literal string values in log message (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
tak-hntlabs authored Aug 21, 2024
1 parent fc3f128 commit 8ceb10e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions packages/stream-metadata/src/riverStreamRpcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ async function getStreamClient(log: FastifyBaseLogger, streamId: `0x${string}`)
clients.set(client.url!, client)
url = client.url!
}
logger.info({ url }, `client connected to node ${url}`)
logger.info({ url }, 'client connected to node')

const client = clients.get(url)
if (!client) {
throw new Error(`Failed to get client for url ${url}`)
logger.error({ url }, 'Failed to get client for url')
throw new Error('Failed to get client for url')
}

return { client, lastMiniblockNum: node.lastMiniblockNum }
Expand Down Expand Up @@ -98,7 +99,7 @@ async function mediaContentFromStreamView(
spaceId: mediaInfo.spaceId,
mediaStreamId: streamView.mediaContent.streamId,
},
`decrypting media content in stream ${streamView.mediaContent.streamId}`,
'decrypting media content in stream',
)

// Aggregate data chunks into a single Uint8Array
Expand Down Expand Up @@ -134,7 +135,7 @@ async function mediaContentFromStreamView(
mediaStreamId: streamView.mediaContent.streamId,
mimeType,
},
`decrypted media content in stream ${streamView.mediaContent.streamId}`,
'decrypted media content in stream',
)

// Return decrypted data and MIME type
Expand Down Expand Up @@ -171,7 +172,7 @@ export async function getStream(
streamId,
lastMiniblockNum: lastMiniblockNum.toString(),
},
`getStream ${streamId}`,
'getStream',
)

const start = Date.now()
Expand All @@ -185,7 +186,7 @@ export async function getStream(
{
duration_ms,
},
`getStream finished in ${duration_ms}ms`,
'getStream finished',
)

const unpackedResponse = await unpackStream(response.stream)
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-metadata/src/streamRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getNodeForStream(
streamId: StreamIdHex,
): Promise<{ url: string; lastMiniblockNum: BigNumber }> {
const logger = getFunctionLogger(log, 'getNodeForStream')
logger.info({ streamId }, `find node for stream ${streamId}`)
logger.info({ streamId }, 'find node for stream')

const now = Date.now()
const cachedData = cache[streamId]
Expand Down

0 comments on commit 8ceb10e

Please sign in to comment.