parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

feat: Add `silent` log level for Cloud Code

Open dplewis opened this issue 2 years ago • 2 comments

Pull Request

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

dplewis avatar Nov 10 '23 02:11 dplewis

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.

codecov[bot] avatar Nov 10 '23 02:11 codecov[bot]

🎉 This change has been released in version 7.0.0-alpha.31

parseplatformorg avatar Mar 21 '24 15:03 parseplatformorg

🎉 This change has been released in version 7.1.0-alpha.1

parseplatformorg avatar Mar 23 '24 00:03 parseplatformorg

🎉 This change has been released in version 7.1.0-beta.1

parseplatformorg avatar Jun 30 '24 02:06 parseplatformorg

🎉 This change has been released in version 7.1.0

parseplatformorg avatar Jun 30 '24 02:06 parseplatformorg