You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, registering any trigger will stringify input/results and call the associated logTrigger* utilities, which internally do an early return after checking logLevel, which is passed in as a param based on config.logLevels.triggerAfter, config.logLevels.triggerBeforeSuccess etc.
The given log utility will then early return or truncate the stringified value, but if we know the loglevel from the caller we can avoid the serialization overhead altogether.
Steps to reproduce
Set logLevels.triggerAfter to silent
Register any Cloud Code hook eg afterFind
Trigger the hook and attach to the Parse Server process
Actual Outcome
In triggers.js, the result is stringified before being discarded inside the logger function
Expected Outcome
It'd be nice to avoid serializing objects we don't intend to log
Environment
v7.1.0-alpha.9
Server
Parse Server version: v7.1.0-alpha.9
Operating system: Alpine Linux 3.18 (from node:18-alpine3.18 docker image)
Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Google Cloud
Database
System (MongoDB or Postgres): MongoDB
Database version: 6
Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas
Issue Description
Currently, registering any trigger will stringify input/results and call the associated
logTrigger*
utilities, which internally do an early return after checking logLevel, which is passed in as a param based onconfig.logLevels.triggerAfter
,config.logLevels.triggerBeforeSuccess
etc.The given log utility will then early return or truncate the stringified value, but if we know the loglevel from the caller we can avoid the serialization overhead altogether.
Steps to reproduce
afterFind
Actual Outcome
In triggers.js, the result is stringified before being discarded inside the logger function
Expected Outcome
It'd be nice to avoid serializing objects we don't intend to log
Environment
v7.1.0-alpha.9
Server
Database
Client
Logs
The text was updated successfully, but these errors were encountered: