Unverified Commit 2e4ceb57 authored by Joyee Cheung's avatar Joyee Cheung
Browse files

util: access process states lazily in debuglog

`debuglog()` depends on `process.pid` and `process.env.NODE_DEBUG`,
so it needs to be called lazily in top scopes of internal modules
that may be loaded before these run time states are allowed to
be accessed. This patch makes its implementation lazy by default,
the process states are only accessed when the returned debug
function is called for the first time.

PR-URL: https://github.com/nodejs/node/pull/27281


Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarRichard Lau <riclau@uk.ibm.com>
Reviewed-By: default avatarYongsheng Zhang <zyszys98@gmail.com>
parent 49ee0100
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment