parse-server
parse-server copied to clipboard
feat: Add `silent` log level for Cloud Code
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
Currently Cloud Code logs use JSON.stringify even if they aren't displayed to the console. JSON.stringify is one of the most CPU-intensive and this will improve performance. If you return a large amount of data from a cloud code function JSON.stringify will return Invalid string length error message.
Closes: https://github.com/parse-community/parse-server/issues/8418
Approach
Add silent support to logLevels Parse Server Config. Enable silent cloud code logs by default for the test suite to improve speed.
{
...
logLevels: {
cloudFunctionSuccess: 'silent',
cloudFunctionError: 'silent',
triggerAfter: 'silent',
triggerBeforeError: 'silent',
triggerBeforeSuccess: 'silent',
},
}
Tasks
- [x] Add tests
- [x] Add changes to documentation (guides, repository pages, code comments)
- [x] Add security check
- [x] Add new Parse Error codes to Parse JS SDK
Thanks for opening this pull request!
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.17%. Comparing base (
907ad42) to head (46f900c). Report is 1 commits behind head on alpha.
Additional details and impacted files
@@ Coverage Diff @@
## alpha #8803 +/- ##
==========================================
+ Coverage 94.15% 94.17% +0.01%
==========================================
Files 186 186
Lines 14679 14688 +9
==========================================
+ Hits 13821 13832 +11
+ Misses 858 856 -2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🎉 This change has been released in version 7.0.0-alpha.31
🎉 This change has been released in version 7.1.0-alpha.1
🎉 This change has been released in version 7.1.0-beta.1
🎉 This change has been released in version 7.1.0