| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5127c70 commit 6aa797b
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -164,6 +164,20 @@ inline void FORCE_INLINE Debug(AsyncWrap* async_wrap, | |||
| 164 | 164 | Debug(async_wrap, format.c_str(), std::forward<Args>(args)...); | |
| 165 | 165 | } | |
| 166 | 166 | ||
| 167 | + namespace per_process { | ||
| 168 | + | ||
| 169 | + template <typename... Args> | ||
| 170 | + inline void FORCE_INLINE Debug(DebugCategory cat, | ||
| 171 | + const char* format, | ||
| 172 | + Args&&... args) { | ||
| 173 | + Debug(&enabled_debug_list, cat, format, std::forward<Args>(args)...); | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + inline void FORCE_INLINE Debug(DebugCategory cat, const char* message) { | ||
| 177 | + Debug(&enabled_debug_list, cat, message); | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + } // namespace per_process | ||
| 167 | 181 | } // namespace node | |
| 168 | 182 | ||
| 169 | 183 | #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,6 +54,9 @@ | |||
| 54 | 54 | #endif // _WIN32 | |
| 55 | 55 | ||
| 56 | 56 | namespace node { | |
| 57 | + namespace per_process { | ||
| 58 | + EnabledDebugList enabled_debug_list; | ||
| 59 | + } | ||
| 57 | 60 | ||
| 58 | 61 | void EnabledDebugList::Parse(Environment* env) { | |
| 59 | 62 | std::string cats; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,6 +161,16 @@ class NativeSymbolDebuggingContext { | |||
| 161 | 161 | void CheckedUvLoopClose(uv_loop_t* loop); | |
| 162 | 162 | void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream); | |
| 163 | 163 | ||
| 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 | ||
| 164 | 174 | } // namespace node | |
| 165 | 175 | ||
| 166 | 176 | #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -916,6 +916,10 @@ void Init(int* argc, | |||
| 916 | 916 | } | |
| 917 | 917 | ||
| 918 | 918 | InitializationResult InitializeOncePerProcess(int argc, char** argv) { | |
| 919 | + // Initialized the enabled list for Debug() calls with system | ||
| 920 | + // environment variables. | ||
| 921 | + per_process::enabled_debug_list.Parse(nullptr); | ||
| 922 | + | ||
| 919 | 923 | atexit(ResetStdio); | |
| 920 | 924 | PlatformInit(); | |
| 921 | 925 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments