Do not override console.log
Open
Nobody has claimed this yet.
P3: Medium
SYS: Daemon
T: Enhancement
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Expected behaviour
Using PM2 programmatically should not override console.log's native behavior when PM2 daemon is not spawned.
For example, console.log({a: 2}) should print { a: 2 }
Actual behaviour
Utility.overrideConsole() is called
In the example above, 2017-03-16 15:27:05: [object Object] is printed 😞
Steps to reproduce
$ pm2 kill
require('pm2').connect(true, () => console.log({a: 2}))
Software versions used
OS : Windows 10
node.js : v6.10.0
PM2 :2.0.12 up to 2.4.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the programmatic connect path from require('pm2').connect(true, ...) to Utility.overrideConsole(). Reproduce the issue after pm2 kill with console.log({a: 2}); done means the native object formatting remains unchanged when the PM2 daemon is not spawned, while normal PM2 behavior is preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100