Skip to content

Commit

Permalink
Merge pull request #1989 from Expensify/revert-1988-dsilva_removeLogP…
Browse files Browse the repository at this point in the history
…aramsThatAreNotRelatedToBedrock

Revert "Remove log params that are not related to Bedrock"
  • Loading branch information
danieldoglas authored Nov 29, 2024
2 parents fa45582 + 59d2205 commit 60731e6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
46 changes: 41 additions & 5 deletions libstuff/SLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,57 @@ void SLogStackTrace(int level) {
}

// If the param name is not in this whitelist, we will log <REDACTED> in addLogParams.
static set<string> PARAMS_WHITELIST = {
static const set<string> PARAMS_WHITELIST = {
"accountID",
"authEmail",
"accountIDs",
"attendees",
"bankAccountID",
"cardData",
"cardID",
"clientUpdateID",
"command",
"companyName",
"companyWebsite",
"Connection",
"Content-Length",
"count",
"currentTime",
"domainAccountID",
"domainName",
"email",
"errorMessage",
"feed",
"feedCountry",
"feedID",
"feedName",
"field",
"index",
"indexName",
"invoice",
"isUnique",
"key",
"lastIP",
"logParam",
"nvpName",
"policyAccountID",
"policyID",
"reimbursementEntryID",
"reportID",
"requestID",
"requestTimestamp",
"secondaryLogin",
"shouldCompleteOnboarding",
"shouldDismissHybridAppOnboarding",
"status",
"step",
"timeDiff",
"token",
"transactionID",
"type",
"userID",
"secondaryLogin",
"walletBankAccountID"
};

string addLogParams(string&& message, const STable& params) {
Expand All @@ -74,7 +114,3 @@ string addLogParams(string&& message, const STable& params) {

return message;
}

void SWhitelistLogParams(set<string> params) {
PARAMS_WHITELIST.insert(params.begin(), params.end());
}
3 changes: 0 additions & 3 deletions libstuff/libstuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ void SLogLevel(int level);
// Stack trace logging
void SLogStackTrace(int level = LOG_WARNING);

// This method will allow plugins to whitelist log params they need to log.
void SWhitelistLogParams(set<string> params);

// This is a drop-in replacement for syslog that directly logs to `/run/systemd/journal/syslog` bypassing journald.
void SSyslogSocketDirect(int priority, const char* format, ...);

Expand Down

0 comments on commit 60731e6

Please sign in to comment.