src: implement per-process native Debug() printer · nodejs/node@6aa797b · GitHub
Skip to content

Commit 6aa797b

Browse files
joyeecheungMylesBorins
authored andcommitted
src: implement per-process native Debug() printer
This patch adds a per-process native Debug() printer that can be called when an Environment is not available. PR-URL: #31884 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 5127c70 commit 6aa797b

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

src/debug_utils-inl.h

Lines changed: 14 additions & 0 deletions

src/debug_utils.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
#endif // _WIN32
5555

5656
namespace node {
57+
namespace per_process {
58+
EnabledDebugList enabled_debug_list;
59+
}
5760

5861
void EnabledDebugList::Parse(Environment* env) {
5962
std::string cats;

src/debug_utils.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ class NativeSymbolDebuggingContext {
161161
void CheckedUvLoopClose(uv_loop_t* loop);
162162
void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream);
163163

164+
namespace per_process {
165+
extern EnabledDebugList enabled_debug_list;
166+
167+
template <typename... Args>
168+
inline void FORCE_INLINE Debug(DebugCategory cat,
169+
const char* format,
170+
Args&&... args);
171+
172+
inline void FORCE_INLINE Debug(DebugCategory cat, const char* message);
173+
} // namespace per_process
164174
} // namespace node
165175

166176
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

src/node.cc

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)