src: print MKSNAPSHOT debug logs to stderr

PR-URL: https://github.com/nodejs/node/pull/50759
Refs: https://github.com/nodejs/node/issues/50740
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Joyee Cheung 2023-11-16 23:25:35 +01:00 committed by Node.js GitHub Bot
parent ef5c8e4593
commit 973f30b16f
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ void Realm::PrintInfoForSnapshot() {
fprintf(stderr, "BaseObjects of the Realm:\n");
size_t i = 0;
ForEachBaseObject([&](BaseObject* obj) {
std::cout << "#" << i++ << " " << obj << ": " << obj->MemoryInfoName()
std::cerr << "#" << i++ << " " << obj << ": " << obj->MemoryInfoName()
<< "\n";
});

View File

@ -1075,7 +1075,7 @@ ExitCode SnapshotBuilder::CreateSnapshot(SnapshotData* out,
if (per_process::enabled_debug_list.enabled(DebugCategory::MKSNAPSHOT)) {
env->ForEachRealm([](Realm* realm) { realm->PrintInfoForSnapshot(); });
printf("Environment = %p\n", env);
fprintf(stderr, "Environment = %p\n", env);
}
// Serialize the native states