Skip to content

Commit cfe59d4

Browse files
committed
feat: add debug runtime detail log handling
1 parent 19d56eb commit cfe59d4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

NativeScript/runtime/ArgConverter.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@
622622
std::string className = object_getClassName(target);
623623
auto it = cache->ClassPrototypes.find(className);
624624
if (it != cache->ClassPrototypes.end()) {
625+
// for debugging rlv cell handling:
626+
// NSString* message = [NSString stringWithFormat:@"ArgConverter::CreateJsWrapper FindMeta: class {%@}", NSStringFromClass(klass)];
627+
// Log(@"%@", message);
625628
Local<Value> prototype = it->second->Get(isolate);
626629
bool success;
627630
if (!receiver->SetPrototype(context, prototype).To(&success) || !success) {

NativeScript/runtime/Interop.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,7 @@ void LogWriteValueTraceMessage(Local<Context> context, const TypeEncoding* typeE
15351535

15361536
void Interop::ExecuteWriteValueDebugValidationsIfInDebug(Local<Context> context, const TypeEncoding* typeEncoding, void* dest, Local<Value> arg) {
15371537

1538-
if (!RuntimeConfig.IsDebug) {
1539-
return;
1540-
}
1538+
#ifdef DEBUG
15411539
id value = Runtime::GetAppConfigValue("logRuntimeDetail");
15421540
bool logRuntimeDetail = value ? [value boolValue] : false;
15431541
if (logRuntimeDetail) {
@@ -1550,6 +1548,7 @@ void LogWriteValueTraceMessage(Local<Context> context, const TypeEncoding* typeE
15501548
LogWriteValueTraceMessage(context, typeEncoding, dest, arg);
15511549
ExecuteWriteValueValidationsAndStopExecutionAndLogStackTrace(context, typeEncoding, dest, arg);
15521550
}
1551+
#endif
15531552
}
15541553

15551554
}

NativeScript/runtime/MetadataBuilder.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@
812812
Class klass = objc_getClass(containingClass.c_str());
813813
// TODO: Find out if the isMethodCallback property can be determined based on a UITableViewController.prototype.viewDidLoad.call(this) or super.viewDidLoad() call
814814

815-
if (RuntimeConfig.IsDebug) {
815+
#ifdef DEBUG
816816
id value = Runtime::GetAppConfigValue("logRuntimeDetail");
817817
bool logRuntimeDetail = value ? [value boolValue] : false;
818818
if (logRuntimeDetail) {
@@ -825,7 +825,7 @@
825825
meta->topLevelModule()->getName()];
826826
Log(@"%@", message);
827827
}
828-
}
828+
#endif
829829

830830
try {
831831
return ArgConverter::Invoke(context, klass, receiver, args, meta, isMethodCallback);

0 commit comments

Comments
 (0)