Skip to content

Commit d27edb8

Browse files
committed
TEMP: Print when calling into weak-node-api
1 parent 7a3f95c commit d27edb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-native-node-api-modules/scripts/generate-weak-node-api.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ export function generateNodeApiFunctionStubBody({
100100
if (!real_func) {
101101
void* handle = dlopen("${libraryPath}", RTLD_LAZY | RTLD_GLOBAL);
102102
if (!handle) {
103-
fprintf(stderr, "Failed to load ${libraryPath}: %s\\n", dlerror());
103+
fprintf(stderr, "Failed to load ${libraryPath} while deferring ${name}: %s\\n", dlerror());
104104
${fallbackReturnStatement}
105105
}
106106
107107
real_func = (${name}_t)dlsym(handle, "${name}");
108108
if (!real_func) {
109-
fprintf(stderr, "Failed to find symbol: %s\\n", dlerror());
109+
fprintf(stderr, "Failed to find symbol while deferring ${name}: %s\\n", dlerror());
110110
${fallbackReturnStatement}
111111
}
112112
}
@@ -122,9 +122,11 @@ typedef ${returnType} (*${name}_t)(${argumentTypes.join(", ")});
122122
${returnType} ${name}(${argumentTypes
123123
.map((type, index) => `${type} arg${index}`)
124124
.join(", ")}) {
125+
fprintf(stdout, "Calling ${name} [weak-node-api]\\n");
125126
#ifdef NODE_API_REEXPORT
126127
${generateNodeApiFunctionStubBody(decl)}
127128
#else
129+
fprintf(stderr, "Returning generic error for ${name}\\n");
128130
${fallbackReturnStatement}
129131
#endif
130132
}`;

0 commit comments

Comments
 (0)