Closed as not planned
Closed as not planned
Description
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 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
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc): N/A
- SDK version: N/A