Skip to content

Commit

Permalink
change log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiAndreiev committed Aug 27, 2024
1 parent f49a707 commit e656002
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/node/src/lib/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ function doSend(readmeApiKey: string, options: Options) {
metricsAPICall(readmeApiKey, json, options).catch(err => {
// Silently discard errors and timeouts.
if (options.development) {
logger.error({ message: 'Error making API call', err });
logger.error({ message: 'Failed to capture API request.', err });
}
});

logger.debug({ message: 'Queue is cleared.', args: { queue } });
logger.debug({ message: 'Queue flushed.', args: { queue } });
}
// Make sure we flush the queue if the process is exited
process.on('exit', doSend);
Expand Down Expand Up @@ -83,7 +83,7 @@ function setDocumentationHeader(res: ServerResponse, baseLogUrl: string, logId:
if (res.headersSent) return;
const documentationUrl = `${baseLogUrl}/logs/${logId}`;
logger.verbose({
message: 'The documentation URL is created.',
message: 'Created URL to your API request log.',
args: { 'x-documentation-url': documentationUrl },
});
res.setHeader('x-documentation-url', documentationUrl);
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/lib/process-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function parseRequestBody(body: string, mimeType: string): Record<string, unknow
try {
return JSON.parse(body);
} catch (err) {
logger.error({ message: 'Error parsing request body JSON (process-request)', err });
logger.error({ message: 'Error parsing request body JSON.', err });
}
}

Expand Down

0 comments on commit e656002

Please sign in to comment.