diff options
Diffstat (limited to 'src/mongo/scripting/mozjs/implscope.cpp')
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index 7c2f57a04ef..75f4a902a37 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -43,6 +43,7 @@ #include "mongo/base/error_codes.h" #include "mongo/config.h" #include "mongo/db/operation_context.h" +#include "mongo/logv2/log.h" #include "mongo/platform/decimal128.h" #include "mongo/platform/mutex.h" #include "mongo/platform/stack_locator.h" @@ -224,8 +225,13 @@ void MozJSImplScope::_gcCallback(JSContext* rt, JSGCStatus status, void* data) { return; } - log() << "MozJS GC " << (status == JSGC_BEGIN ? "prologue" : "epilogue") << " heap stats - " - << " total: " << mongo::sm::get_total_bytes() << " limit: " << mongo::sm::get_max_bytes(); + LOGV2(22787, + "MozJS GC {status_JSGC_BEGIN_prologue_epilogue} heap stats - total: " + "{mongo_sm_get_total_bytes} limit: {mongo_sm_get_max_bytes}", + "status_JSGC_BEGIN_prologue_epilogue"_attr = + (status == JSGC_BEGIN ? "prologue" : "epilogue"), + "mongo_sm_get_total_bytes"_attr = mongo::sm::get_total_bytes(), + "mongo_sm_get_max_bytes"_attr = mongo::sm::get_max_bytes()); } #if __has_feature(address_sanitizer) @@ -275,7 +281,8 @@ MozJSImplScope::MozRuntime::MozRuntime(const MozJSScriptEngine* engine, jsHeapLimitMB ? std::min(*jsHeapLimitMB, engineJsHeapLimit) : engineJsHeapLimit; if (jsHeapLimit != 0 && jsHeapLimit < 10) { - warning() << "JavaScript may not be able to initialize with a heap limit less than 10MB."; + LOGV2_WARNING(22788, + "JavaScript may not be able to initialize with a heap limit less than 10MB."); } size_t mallocMemoryLimit = 1024ul * 1024 * jsHeapLimit; mongo::sm::reset(mallocMemoryLimit); @@ -699,7 +706,7 @@ int MozJSImplScope::invoke(ScriptingFunction func, // must validate the handle because TerminateExecution may have // been thrown after the above checks if (out.isObject() && _nativeFunctionProto.instanceOf(out)) { - warning() << "storing native function as return value"; + LOGV2_WARNING(22789, "storing native function as return value"); _lastRetIsNativeCode = true; } else { _lastRetIsNativeCode = false; |