History

Add V8 logging category

Rename logging category to overte Make all V8 code use logging categories

Dale Glass committed 3 years ago

Commit 0fc2ab81 parent 633319c10 files · +211 −161Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptObjectV8Proxy.cpp (1 of 10 files). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptObjectV8Proxy.cpp+63−62
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222
2323 #include "ScriptContextV8Wrapper.h"
2424 #include "ScriptValueV8Wrapper.h"
25+#include "ScriptEngineLoggingV8.h"
2526
2627 //V8TODO: is this needed for anything? It could cause trouble with multithreading if V8ScriptContext is v8::Persistent
2728 //Q_DECLARE_METATYPE(V8ScriptContext*)
@@ -110,7 +111,7 @@ V8ScriptValue ScriptObjectV8Proxy::newQObject(ScriptEngineV8* engine, QObject* o · 82 unmodified lines
110111 break;
111112 default:
112113 ownsObject = false;
113− qCritical() << "Wrong ScriptEngine::ValueOwnership value: " << ownership;
114+ qCCritical(scriptengine_v8) << "Wrong ScriptEngine::ValueOwnership value: " << ownership;
114115 break;
115116 }
116117
@@ -166,16 +167,16 @@ ScriptObjectV8Proxy* ScriptObjectV8Proxy::unwrapProxy(const V8ScriptValue& val) · 49 unmodified lines
166167 return nullptr;
167168 }
168169 if (!v8Value->IsObject()) {
169− //qDebug(scriptengine) << "Cannot unwrap proxy - value is not an object";
170+ //qCDebug(scriptengine_v8) << "Cannot unwrap proxy - value is not an object";
170171 return nullptr;
171172 }
172173 v8::Local<v8::Object> v8Object = v8::Local<v8::Object>::Cast(v8Value);
173174 if (v8Object->InternalFieldCount() != 3) {
174− //qDebug(scriptengine) << "Cannot unwrap proxy - wrong number of internal fields";
175+ //qCDebug(scriptengine_v8) << "Cannot unwrap proxy - wrong number of internal fields";
175176 return nullptr;
176177 }
177178 if (v8Object->GetAlignedPointerFromInternalField(0) != internalPointsToQObjectProxy) {
178− qDebug(scriptengine) << "Cannot unwrap proxy - internal fields don't point to object proxy";
179+ qCDebug(scriptengine_v8) << "Cannot unwrap proxy - internal fields don't point to object proxy";
179180 return nullptr;
180181 }
181182 return reinterpret_cast<ScriptObjectV8Proxy*>(v8Object->GetAlignedPointerFromInternalField(1));
@@ -189,20 +190,20 @@ ScriptObjectV8Proxy* ScriptObjectV8Proxy::unwrapProxy(v8::Isolate* isolate, v8:: · 7 unmodified lines
189190 //v8::Local<v8::Context> context = val.constGetContext();
190191 //v8::Context::Scope contextScope(context);
191192 if (value->IsNullOrUndefined()) {
192− //qDebug(scriptengine) << "Cannot unwrap proxy - value is not an object";
193+ //qCDebug(scriptengine_v8) << "Cannot unwrap proxy - value is not an object";
193194 return nullptr;
194195 }
195196 if (!value->IsObject()) {
196− //qDebug(scriptengine) << "Cannot unwrap proxy - value is not an object";
197+ //qCDebug(scriptengine_v8) << "Cannot unwrap proxy - value is not an object";
197198 return nullptr;
198199 }
199200 v8::Local<v8::Object> v8Object = v8::Local<v8::Object>::Cast(value);
200201 if (v8Object->InternalFieldCount() != 3) {
201− //qDebug(scriptengine) << "Cannot unwrap proxy - wrong number of internal fields";
202+ //qCDebug(scriptengine_v8) << "Cannot unwrap proxy - wrong number of internal fields";
202203 return nullptr;
203204 }
204205 if (v8Object->GetAlignedPointerFromInternalField(0) != internalPointsToQObjectProxy) {
205− qDebug(scriptengine) << "Cannot unwrap proxy - internal fields don't point to object proxy";
206+ qCDebug(scriptengine_v8) << "Cannot unwrap proxy - internal fields don't point to object proxy";
206207 return nullptr;
207208 }
208209 return reinterpret_cast<ScriptObjectV8Proxy*>(v8Object->GetAlignedPointerFromInternalField(1));
@@ -218,7 +219,7 @@ ScriptObjectV8Proxy::~ScriptObjectV8Proxy() { · 9 unmodified lines
218219 v8::Locker locker(isolate);
219220 v8::Isolate::Scope isolateScope(isolate);
220221 v8::HandleScope handleScope(isolate);
221− if(_object) qDebug(scriptengine) << "Deleting object proxy: " << name();
222+ if(_object) qCDebug(scriptengine_v8) << "Deleting object proxy: " << name();
222223 // V8TODO: once WeakPersistent pointer is added we should check if it's valid before deleting
223224 Q_ASSERT(!_v8Object.Get(isolate)->IsNullOrUndefined());
224225 // This prevents unwrap function from unwrapping proxy that was deleted
@@ -234,7 +235,7 @@ void ScriptObjectV8Proxy::investigate() { · 9 unmodified lines
234235 QObject* qobject = _object;
235236 if (!qobject) {
236237 QStringList backtrace = _engine->currentContext()->backtrace();
237− qDebug(scriptengine) << "ScriptObjectV8Proxy::investigate: Object pointer is NULL, " << backtrace;
238+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::investigate: Object pointer is NULL, " << backtrace;
238239 }
239240 if (!qobject) return;
240241
@@ -251,7 +252,7 @@ void ScriptObjectV8Proxy::investigate() { · 10 unmodified lines
251252
252253 const QMetaObject* metaObject = qobject->metaObject();
253254
254− //qDebug(scriptengine) << "Investigate: " << metaObject->className();
255+ //qCDebug(scriptengine_v8) << "Investigate: " << metaObject->className();
255256 if (QString("ConsoleScriptingInterface") == metaObject->className()) {
256257 printf("ConsoleScriptingInterface");
257258 }
@@ -262,7 +263,7 @@ void ScriptObjectV8Proxy::investigate() { · 4 unmodified lines
262263 QMetaProperty prop = metaObject->property(idx);
263264 if (!prop.isScriptable()) continue;
264265
265− //qDebug(scriptengine) << "Investigate: " << metaObject->className() << " Property: " << prop.name();
266+ //qCDebug(scriptengine_v8) << "Investigate: " << metaObject->className() << " Property: " << prop.name();
266267 // always exclude child objects (at least until we decide otherwise)
267268 int metaTypeId = prop.userType();
268269 if (metaTypeId != QMetaType::UnknownType) {
@@ -285,7 +286,7 @@ void ScriptObjectV8Proxy::investigate() { · 16 unmodified lines
285286 QHash<V8ScriptString, int> methodNames;
286287 for (int idx = startIdx; idx < num; ++idx) {
287288 QMetaMethod method = metaObject->method(idx);
288− //qDebug(scriptengine) << "Investigate: " << metaObject->className() << " Method: " << method.name();
289+ //qCDebug(scriptengine_v8) << "Investigate: " << metaObject->className() << " Method: " << method.name();
289290
290291 // perhaps keep this comment? Calls (like AudioScriptingInterface::playSound) seem to expect non-public methods to be script-accessible
291292 /* if (method.access() != QMetaMethod::Public) continue;*/
@@ -319,9 +320,9 @@ void ScriptObjectV8Proxy::investigate() { · 27 unmodified lines
319320 SignalDef& signalDef = _signals.insert(idx, SignalDef(_engine, name.get())).value();
320321 signalDef.name = name;
321322 signalDef.signal = method;
322− //qDebug(scriptengine) << "Utf8Value 1: " << QString(*v8::String::Utf8Value(const_cast<v8::Isolate*>(_engine->getIsolate()), nameString));
323− //qDebug(scriptengine) << "Utf8Value 2: " << QString(*v8::String::Utf8Value(const_cast<v8::Isolate*>(_engine->getIsolate()), name.constGet()));
324− //qDebug(scriptengine) << "toQString: " << name.toQString();
323+ //qCDebug(scriptengine_v8) << "Utf8Value 1: " << QString(*v8::String::Utf8Value(const_cast<v8::Isolate*>(_engine->getIsolate()), nameString));
324+ //qCDebug(scriptengine_v8) << "Utf8Value 2: " << QString(*v8::String::Utf8Value(const_cast<v8::Isolate*>(_engine->getIsolate()), name.constGet()));
325+ //qCDebug(scriptengine_v8) << "toQString: " << name.toQString();
325326 methodNames.insert(name, idx);
326327 } else {
327328 int originalMethodId = nameLookup.value();
@@ -336,11 +337,11 @@ void ScriptObjectV8Proxy::investigate() { · 8 unmodified lines
336337 } else {
337338 int parameterCount = method.parameterCount();
338339 if(method.returnType() == QMetaType::UnknownType) {
339− qCritical(scriptengine) << "Method " << metaObject->className() << "::" << name.toQString() << " has QMetaType::UnknownType return value";
340+ qCCritical(scriptengine_v8) << "Method " << metaObject->className() << "::" << name.toQString() << " has QMetaType::UnknownType return value";
340341 }
341342 for (int i = 0; i < method.parameterCount(); i++) {
342343 if (method.parameterType(i) == QMetaType::UnknownType) {
343− qCritical(scriptengine) << "Parameter " << i << "in method " << metaObject->className() << "::" << name.toQString() << " is of type QMetaType::UnknownType";
344+ qCCritical(scriptengine_v8) << "Parameter " << i << "in method " << metaObject->className() << "::" << name.toQString() << " is of type QMetaType::UnknownType";
344345 }
345346 }
346347 if (nameLookup == methodNames.end()) {
@@ -403,7 +404,7 @@ ScriptObjectV8Proxy::QueryFlags ScriptObjectV8Proxy::queryProperty(const V8Scrip · 56 unmodified lines
403404 // check for methods
404405 for (MethodDefMap::const_iterator trans = _methods.cbegin(); trans != _methods.cend(); ++trans) {
405406 v8::String::Utf8Value methodNameStr(isolate, trans.value().name.constGet());
406− //qDebug(scriptengine) << "queryProperty : " << *nameStr << " method: " << *methodNameStr;
407+ //qCDebug(scriptengine_v8) << "queryProperty : " << *nameStr << " method: " << *methodNameStr;
407408 if (!(trans.value().name == name)) continue;
408409 *id = trans.key() | METHOD_TYPE;
409410 return flags & (HandlesReadAccess | HandlesWriteAccess);
@@ -458,17 +459,17 @@ void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCall · 48 unmodified lines
458459 v8::HandleScope handleScope(info.GetIsolate());
459460 //V8TODO: should there be a context scope here?
460461 v8::String::Utf8Value utf8Value(info.GetIsolate(), name);
461− //qDebug(scriptengine) << "Get: " << *utf8Value;
462+ //qCDebug(scriptengine_v8) << "Get: " << *utf8Value;
462463 v8::Local<v8::Value> objectV8 = info.This();
463464 ScriptObjectV8Proxy *proxy = ScriptObjectV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
464465 if (!proxy) {
465− qDebug(scriptengine) << "Proxy object not found when getting: " << *utf8Value;
466+ qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Value;
466467 return;
467468 }
468469 V8ScriptValue object(proxy->_engine, objectV8);
469470 if (!name->IsString() && !name->IsSymbol()) {
470471 QString notStringMessage("ScriptObjectV8Proxy::v8Get: " + proxy->_engine->scriptValueDebugDetailsV8(V8ScriptValue(proxy->_engine, name)));
471− qDebug(scriptengine) << notStringMessage;
472+ qCDebug(scriptengine_v8) << notStringMessage;
472473 Q_ASSERT(false);
473474 }
474475 v8::Local<v8::String> v8NameString;
@@ -481,7 +482,7 @@ void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCall · 6 unmodified lines
481482 }
482483
483484 if (name->IsSymbol()) {
484− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8Set: symbol: " + nameString.toQString();
485+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8Set: symbol: " + nameString.toQString();
485486 }*/
486487 if (name->IsString()) {
487488 V8ScriptString nameString(proxy->_engine, v8::Local<v8::String>::Cast(name));
@@ -498,7 +499,7 @@ void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCall · 10 unmodified lines
498499 if(info.This()->GetInternalField(2).As<v8::Object>()->Get(proxy->_engine->getContext(), name).ToLocal(&property)) {
499500 info.GetReturnValue().Set(property);
500501 } else {
501− qDebug(scriptengine) << "Value not found: " << *utf8Value;
502+ qCDebug(scriptengine_v8) << "Value not found: " << *utf8Value;
502503 }
503504 }
504505
@@ -506,17 +507,17 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v · 1 unmodified line
506507 v8::HandleScope handleScope(info.GetIsolate());
507508 //V8TODO: should there be a context scope here?
508509 v8::String::Utf8Value utf8Value(info.GetIsolate(), name);
509− //qDebug(scriptengine) << "Set: " << *utf8Value;
510+ //qCDebug(scriptengine_v8) << "Set: " << *utf8Value;
510511 v8::Local<v8::Value> objectV8 = info.This();
511512 ScriptObjectV8Proxy *proxy = ScriptObjectV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
512513 if (!proxy) {
513− qDebug(scriptengine) << "Proxy object not found when setting: " << *utf8Value;
514+ qCDebug(scriptengine_v8) << "Proxy object not found when setting: " << *utf8Value;
514515 return;
515516 }
516517 V8ScriptValue object(proxy->_engine, objectV8);
517518 if (!name->IsString() && !name->IsSymbol()) {
518519 QString notStringMessage("ScriptObjectV8Proxy::v8Set: " + proxy->_engine->scriptValueDebugDetailsV8(V8ScriptValue(proxy->_engine, name)));
519− qDebug(scriptengine) << notStringMessage;
520+ qCDebug(scriptengine_v8) << notStringMessage;
520521 Q_ASSERT(false);
521522 }
522523 /*v8::Local<v8::String> v8NameString;
@@ -528,7 +529,7 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v · 5 unmodified lines
528529 }
529530 }
530531 if (name->IsSymbol()) {
531− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8Set: symbol: " + nameString.toQString();
532+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8Set: symbol: " + nameString.toQString();
532533 }*/
533534 //V8ScriptString nameString(info.GetIsolate(), name->ToString(proxy->_engine->getContext()).ToLocalChecked());
534535 if (name->IsString()) {
@@ -545,19 +546,19 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v · 10 unmodified lines
545546 if (info.This()->GetInternalField(2).As<v8::Object>()->Set(proxy->_engine->getContext(), name, value).FromMaybe(false)) {
546547 info.GetReturnValue().Set(value);
547548 } else {
548− qDebug(scriptengine) << "Set failed: " << *utf8Value;
549+ qCDebug(scriptengine_v8) << "Set failed: " << *utf8Value;
549550 }
550551 }
551552
552553 void ScriptObjectV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
553− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
554+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
554555 v8::HandleScope handleScope(info.GetIsolate());
555556 auto context = info.GetIsolate()->GetCurrentContext();
556557 v8::Context::Scope contextScope(context);
557558 v8::Local<v8::Value> objectV8 = info.This();
558559 ScriptObjectV8Proxy *proxy = ScriptObjectV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
559560 if (!proxy) {
560− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames: Proxy object not found when listing";
561+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames: Proxy object not found when listing";
561562 return;
562563 }
563564 V8ScriptValue object(proxy->_engine, objectV8);
@@ -568,7 +569,7 @@ void ScriptObjectV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8:: · 4 unmodified lines
568569 if (info.This()->GetInternalField(2).As<v8::Object>()->GetPropertyNames(context).ToLocal(&objectProperties)) {
569570 for (uint32_t n = 0; n < objectProperties->Length(); n++) {
570571 if(!properties->Set(context, propertiesLength+n, objectProperties->Get(context, n).ToLocalChecked()).FromMaybe(false)) {
571− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames: Cannot add member name";
572+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames: Cannot add member name";
572573 }
573574 }
574575 }
@@ -587,17 +588,17 @@ v8::Local<v8::Array> ScriptObjectV8Proxy::getPropertyNames() { · 12 unmodified lines
587588 uint32_t position = 0;
588589 for (PropertyDefMap::const_iterator i = _props.begin(); i != _props.end(); i++){
589590 if(!properties->Set(context, position++, i.value().name.constGet()).FromMaybe(false)) {
590− qDebug(scriptengine) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
591+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
591592 }
592593 }
593594 for (MethodDefMap::const_iterator i = _methods.begin(); i != _methods.end(); i++){
594595 if(!properties->Set(context, position++, i.value().name.constGet()).FromMaybe(false)) {
595− qDebug(scriptengine) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
596+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
596597 }
597598 }
598599 for (SignalDefMap::const_iterator i = _signals.begin(); i != _signals.end(); i++){
599600 if(!properties->Set(context, position++, i.value().name.constGet()).FromMaybe(false)) {
600− qDebug(scriptengine) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
601+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::getPropertyNames: Cannot add property member name";
601602 }
602603 }
603604 return handleScope.Escape(properties);
@@ -639,7 +640,7 @@ V8ScriptValue ScriptObjectV8Proxy::property(const V8ScriptValue& object, const V · 35 unmodified lines
639640 const MethodDef& methodDef = lookup.value();
640641 for (auto iter = methodDef.methods.begin(); iter != methodDef.methods.end(); iter++ ) {
641642 if((*iter).returnType() == QMetaType::UnknownType) {
642− qDebug(scriptengine) << "Method with QMetaType::UnknownType " << metaObject->className() << " " << (*iter).name();
643+ qCDebug(scriptengine_v8) << "Method with QMetaType::UnknownType " << metaObject->className() << " " << (*iter).name();
643644 }
644645 } //V8TODO: is new method created during every call? It needs to be cached instead
645646 //bool isMethodDefined = false;
@@ -650,7 +651,7 @@ V8ScriptValue ScriptObjectV8Proxy::property(const V8ScriptValue& object, const V · 4 unmodified lines
650651 }
651652 }
652653 Q_ASSERT(false);
653− qDebug(scriptengine) << "(This should not happen) Creating new method object for " << metaObject->className() << " " << name.toQString();
654+ qCDebug(scriptengine_v8) << "(This should not happen) Creating new method object for " << metaObject->className() << " " << name.toQString();
654655 return ScriptMethodV8Proxy::newMethod(_engine, qobject, object, methodDef.methods, methodDef.numMaxParms);
655656 }
656657 case SIGNAL_TYPE: {
@@ -828,7 +829,7 @@ void ScriptVariantV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCal · 171 unmodified lines
828829 v8::Local<v8::Value> objectV8 = info.This();
829830 ScriptVariantV8Proxy *proxy = ScriptVariantV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
830831 if (!proxy) {
831− qDebug(scriptengine) << "Proxy object not found when getting: " << *utf8Name;
832+ qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Name;
832833 return;
833834 }
834835 V8ScriptValue object(proxy->_engine, proxy->_v8Object.Get(info.GetIsolate()));
@@ -844,13 +845,13 @@ void ScriptVariantV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCal · 9 unmodified lines
844845 }
845846 }
846847
847− qDebug(scriptengine) << "Value not found: " << *utf8Name;
848+ qCDebug(scriptengine_v8) << "Value not found: " << *utf8Name;
848849 // V8TODO: this is done differently for variant proxy - use internal field of _v8Object instead?
849850 /*v8::Local<v8::Value> property;
850851 if(info.This()->GetInternalField(2).As<v8::Object>()->Get(proxy->_engine->getContext(), name).ToLocal(&property)) {
851852 info.GetReturnValue().Set(property);
852853 } else {
853− qDebug(scriptengine) << "Value not found: " << *utf8Value;
854+ qCDebug(scriptengine_v8) << "Value not found: " << *utf8Value;
854855 }*/
855856 }
856857
@@ -860,14 +861,14 @@ void ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> · 3 unmodified lines
860861 v8::Local<v8::Value> objectV8 = info.This();
861862 ScriptVariantV8Proxy *proxy = ScriptVariantV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
862863 if (!proxy) {
863− qDebug(scriptengine) << "Proxy object not found when getting: " << *utf8Name;
864+ qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Name;
864865 return;
865866 }
866867
867868 V8ScriptValue object(proxy->_engine, objectV8);
868869 if (!name->IsString() && !name->IsSymbol()) {
869870 QString notStringMessage("ScriptObjectV8Proxy::v8Set: " + proxy->_engine->scriptValueDebugDetailsV8(V8ScriptValue(proxy->_engine, name)));
870− qDebug(scriptengine) << notStringMessage;
871+ qCDebug(scriptengine_v8) << notStringMessage;
871872 Q_ASSERT(false);
872873 }
873874
@@ -885,21 +886,21 @@ void ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> · 11 unmodified lines
885886 /*if (info.This()->GetInternalField(2).As<v8::Object>()->Set(proxy->_engine->getContext(), name, value).FromMaybe(false)) {
886887 info.GetReturnValue().Set(value);
887888 } else {
888− qDebug(scriptengine) << "Set failed: " << *utf8Name;
889+ qCDebug(scriptengine_v8) << "Set failed: " << *utf8Name;
889890 }*/
890− qDebug(scriptengine) << "Set failed: " << *utf8Name;
891+ qCDebug(scriptengine_v8) << "Set failed: " << *utf8Name;
891892 }
892893
893894 void ScriptVariantV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
894895 //V8TODO: Only methods from the prototype should be listed.
895− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
896+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames called";
896897 v8::HandleScope handleScope(info.GetIsolate());
897898 auto context = info.GetIsolate()->GetCurrentContext();
898899 v8::Context::Scope contextScope(context);
899900 v8::Local<v8::Value> objectV8 = info.This();
900901 ScriptVariantV8Proxy *proxy = ScriptVariantV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
901902 if (!proxy) {
902− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames: Proxy object not found when listing";
903+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames: Proxy object not found when listing";
903904 return;
904905 }
905906 V8ScriptValue object(proxy->_engine, objectV8);
@@ -910,7 +911,7 @@ void ScriptVariantV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8: · 4 unmodified lines
910911 if (info.This()->GetInternalField(2).As<v8::Object>()->GetPropertyNames(context).ToLocal(&objectProperties)) {
911912 for (uint32_t n = 0; n < objectProperties->Length(); n++) {
912913 if(!properties->Set(context, propertiesLength+n, objectProperties->Get(context, n).ToLocalChecked()).FromMaybe(false)) {
913− qDebug(scriptengine) << "ScriptObjectV8Proxy::v8GetPropertyNames: Cannot add member name";
914+ qCDebug(scriptengine_v8) << "ScriptObjectV8Proxy::v8GetPropertyNames: Cannot add member name";
914915 }
915916 }
916917 }*/
@@ -929,7 +930,7 @@ ScriptMethodV8Proxy::ScriptMethodV8Proxy(ScriptEngineV8* engine, QObject* object · 12 unmodified lines
929930 }
930931
931932 ScriptMethodV8Proxy::~ScriptMethodV8Proxy() {
932− qDebug(scriptengine) << "ScriptMethodV8Proxy destroyed";
933+ qCDebug(scriptengine_v8) << "ScriptMethodV8Proxy destroyed";
933934 printf("ScriptMethodV8Proxy destroyed");
934935 }
935936
@@ -1107,7 +1108,7 @@ void ScriptMethodV8Proxy::call(const v8::FunctionCallbackInfo<v8::Value>& argume · 171 unmodified lines
11071108 // nothing in there for return values so these need to be explicitly runtime-registered!
11081109 if (returnTypeId == QMetaType::UnknownType) {
11091110 QString methodName = fullName();
1110− qDebug(scriptengine) << "returnTypeId == QMetaType::UnknownType for method " << methodName;
1111+ qCDebug(scriptengine_v8) << "returnTypeId == QMetaType::UnknownType for method " << methodName;
11111112 _engine->logBacktrace("");
11121113 //Q_ASSERT(false);
11131114 }
@@ -1173,7 +1174,7 @@ void ScriptMethodV8Proxy::call(const v8::FunctionCallbackInfo<v8::Value>& argume · 59 unmodified lines
11731174 QByteArray argTypeName = _engine->valueType(V8ScriptValue(_engine, argVal)).toLatin1();
11741175 QString errorMessage = QString("Native call of %1 failed: Cannot convert parameter %2 from %3 to %4")
11751176 .arg(fullName()).arg(arg+1).arg(argTypeName, methodTypeName);
1176− qDebug(scriptengine) << errorMessage << "\n Backtrace:" << _engine->currentContext()->backtrace();
1177+ qCDebug(scriptengine_v8) << errorMessage << "\n Backtrace:" << _engine->currentContext()->backtrace();
11771178 isolate->ThrowError(v8::String::NewFromUtf8(isolate, errorMessage.toStdString().c_str()).ToLocalChecked());
11781179 //context->throwError(V8ScriptContext::TypeError, QString("Native call of %1 failed: Cannot convert parameter %2 from %3 to %4")
11791180 // .arg(fullName()).arg(arg+1).arg(argTypeName, methodTypeName));
@@ -1182,7 +1183,7 @@ void ScriptMethodV8Proxy::call(const v8::FunctionCallbackInfo<v8::Value>& argume · 2 unmodified lines
11821183 }
11831184 }
11841185 QString errorMessage = QString("Native call of %1 failed: could not locate an overload with the requested arguments").arg(fullName());
1185− qDebug(scriptengine) << errorMessage;
1186+ qCDebug(scriptengine_v8) << errorMessage;
11861187 isolate->ThrowError(v8::String::NewFromUtf8(isolate, errorMessage.toStdString().c_str()).ToLocalChecked());
11871188 // V8TODO: it happens sometimes for some reason
11881189 Q_ASSERT(false); // really shouldn't have gotten here -- it didn't work before and it's working now?
@@ -1384,7 +1385,7 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu · 195 unmodified lines
13841385
13851386 _callCounter++;
13861387 if (_callCounter % 10 == 0) {
1387− qDebug() << "Script engine: " << _engine->manager()->getFilename() << " Signal proxy " << fullName()
1388+ qCDebug(scriptengine_v8) << "Script engine: " << _engine->manager()->getFilename() << " Signal proxy " << fullName()
13881389 << " call count: " << _callCounter << " total time: " << _totalCallTime_s;
13891390 }
13901391 QElapsedTimer callTimer;
@@ -1434,7 +1435,7 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu · 43 unmodified lines
14341435 /*if (!conn.callback.get()->IsFunction()) {
14351436 auto stringV8 = conn.callback.get()->ToDetailString(context).ToLocalChecked();
14361437 QString error = *v8::String::Utf8Value(_engine->getIsolate(), stringV8);
1437− qDebug() << error;
1438+ qCDebug(scriptengine_v8) << error;
14381439 Q_ASSERT(false);
14391440 }
14401441 v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(conn.callback.get());
@@ -1449,14 +1450,14 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu · 8 unmodified lines
14491450 Q_ASSERT(!conn.callback.get().IsEmpty());
14501451 Q_ASSERT(!conn.callback.get()->IsUndefined());
14511452 if (conn.callback.get()->IsNull()) {
1452− qDebug() << "ScriptSignalV8Proxy::qt_metacall: Connection callback is Null";
1453+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::qt_metacall: Connection callback is Null";
14531454 _engine->popContext();
14541455 continue;
14551456 }
14561457 if (!conn.callback.get()->IsFunction()) {
14571458 auto stringV8 = conn.callback.get()->ToDetailString(functionContext).ToLocalChecked();
14581459 QString error = *v8::String::Utf8Value(_engine->getIsolate(), stringV8);
1459− qDebug() << error;
1460+ qCDebug(scriptengine_v8) << error;
14601461 Q_ASSERT(false);
14611462 }
14621463 v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(conn.callback.get());
@@ -1577,7 +1578,7 @@ void ScriptSignalV8Proxy::connect(ScriptValue arg0, ScriptValue arg1) { · 114 unmodified lines
15771578 Q_ASSERT(ScriptObjectV8Proxy::unwrapProxy(v8ThisObject));
15781579 ScriptSignalV8Proxy* thisProxy = dynamic_cast<ScriptSignalV8Proxy*>(ScriptObjectV8Proxy::unwrapProxy(v8ThisObject)->toQObject());
15791580 Q_ASSERT(thisProxy);
1580− qDebug(scriptengine) << "ScriptSignalV8Proxy::connect: " << thisProxy->fullName() << " fullName: " << fullName();
1581+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::connect: " << thisProxy->fullName() << " fullName: " << fullName();
15811582 //Q_ASSERT(destFunction->InternalFieldCount() == 4);
15821583 //Q_ASSERT(destData.get()->IsArray());
15831584 //v8::Local<v8::Value> destData = destFunction->GetInternalField(3);
@@ -1593,14 +1594,14 @@ void ScriptSignalV8Proxy::connect(ScriptValue arg0, ScriptValue arg1) { · 9 unmodified lines
15931594 for (int idx = 0; idx < length && !foundIt; ++idx) {
15941595 v8::Local<v8::Value> entry = destArray->Get(destFunctionContext, idx).ToLocalChecked();
15951596 {
1596− qDebug() << "ScriptSignalV8Proxy::connect: entry details: " << _engine->scriptValueDebugDetailsV8(V8ScriptValue(_engine, entry));
1597+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::connect: entry details: " << _engine->scriptValueDebugDetailsV8(V8ScriptValue(_engine, entry));
15971598 Q_ASSERT(entry->IsObject());
15981599 V8ScriptValue v8EntryObject(_engine, entry);
15991600 Q_ASSERT(ScriptObjectV8Proxy::unwrapProxy(v8EntryObject));
16001601 // For debugging
16011602 ScriptSignalV8Proxy* entryProxy = dynamic_cast<ScriptSignalV8Proxy*>(ScriptObjectV8Proxy::unwrapProxy(v8EntryObject)->toQObject());
16021603 Q_ASSERT(thisProxy);
1603− qDebug(scriptengine) << "ScriptSignalV8Proxy::connect: entry proxy: " << entryProxy->fullName();
1604+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::connect: entry proxy: " << entryProxy->fullName();
16041605 }
16051606 if (!newArray->Set(destFunctionContext, idx, entry).FromMaybe(false)) {
16061607 Q_ASSERT(false);
@@ -1712,7 +1713,7 @@ void ScriptSignalV8Proxy::disconnect(ScriptValue arg0, ScriptValue arg1) { · 105 unmodified lines
17121713 // For debugging
17131714 ScriptSignalV8Proxy* thisProxy = dynamic_cast<ScriptSignalV8Proxy*>(ScriptObjectV8Proxy::unwrapProxy(v8ThisObject)->toQObject());
17141715 Q_ASSERT(thisProxy);
1715− qDebug(scriptengine) << "ScriptSignalV8Proxy::disconnect: " << thisProxy->fullName() << " fullName: " << fullName();
1716+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::disconnect: " << thisProxy->fullName() << " fullName: " << fullName();
17161717 //V8ScriptValue destData = callback.data();
17171718 //Q_ASSERT(destData->IsArray());
17181719 if (!destFunction->Get(destFunctionContext, destDataName).ToLocal(&destData)) {
@@ -1730,7 +1731,7 @@ void ScriptSignalV8Proxy::disconnect(ScriptValue arg0, ScriptValue arg1) { · 11 unmodified lines
17301731 // For debugging:
17311732 {
17321733 _engine->logBacktrace("ScriptSignalV8Proxy::disconnect");
1733− qDebug() << "ScriptSignalV8Proxy::disconnect: entry details: " << _engine->scriptValueDebugDetailsV8(V8ScriptValue(_engine, entry))
1734+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::disconnect: entry details: " << _engine->scriptValueDebugDetailsV8(V8ScriptValue(_engine, entry))
17341735 << " Array: " << _engine->scriptValueDebugDetailsV8(V8ScriptValue(_engine, destArray));
17351736 Q_ASSERT(entry->IsObject());
17361737 V8ScriptValue v8EntryObject(_engine, entry);
@@ -1738,12 +1739,12 @@ void ScriptSignalV8Proxy::disconnect(ScriptValue arg0, ScriptValue arg1) { · 1 unmodified line
17381739 // For debugging
17391740 ScriptSignalV8Proxy* entryProxy = dynamic_cast<ScriptSignalV8Proxy*>(ScriptObjectV8Proxy::unwrapProxy(v8EntryObject)->toQObject());
17401741 Q_ASSERT(thisProxy);
1741− qDebug(scriptengine) << "ScriptSignalV8Proxy::disconnect: entry proxy: " << entryProxy->fullName();
1742+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::disconnect: entry proxy: " << entryProxy->fullName();
17421743 }
17431744 if (entry->StrictEquals(v8ThisObject.get())) {
17441745 //V8TODO: compare proxies instead?
17451746 foundIt = true;
1746− qDebug() << "ScriptSignalV8Proxy::disconnect foundIt";
1747+ qCDebug(scriptengine_v8) << "ScriptSignalV8Proxy::disconnect foundIt";
17471748 //V8ScriptValueList args;
17481749 //args << idx << 1;
17491750 //destData.property("splice").call(destData, args);