Skip to content

Commit

Permalink
chore: update request & response logs to info level, remove level bas…
Browse files Browse the repository at this point in the history
…ed filtering
  • Loading branch information
Sai Sankeerth committed Jun 21, 2024
1 parent 2ead5a8 commit 129965b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const error = (...args) => {
const requestLog = (identifierMsg, { metadata, requestDetails: { url, body, method } }) => {
const logger = getLogger();
const filteredMetadata = getMatchedMetadata(metadata);
if (LOGLEVELS[logLevel] === LOGLEVELS.warn && filteredMetadata.length > 0) {
if (filteredMetadata.length > 0) {
const reqLogArgs = [identifierMsg, { metadata: filteredMetadata, url, body, method }];
log(logger.warn, reqLogArgs);
}
Expand All @@ -176,9 +176,9 @@ const responseLog = (
) => {
const logger = getLogger();
const filteredMetadata = getMatchedMetadata(metadata);
if (LOGLEVELS[logLevel] === LOGLEVELS.warn && filteredMetadata.length > 0) {
if (filteredMetadata.length > 0) {
const resLogArgs = [identifierMsg, { metadata: filteredMetadata, body, status, headers }];
log(logger.warn, resLogArgs);
log(logger.info, resLogArgs);
}
};

Expand Down

0 comments on commit 129965b

Please sign in to comment.