Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider logging return value of function call #967

Open
vringar opened this issue Jan 16, 2022 · 1 comment
Open

Consider logging return value of function call #967

vringar opened this issue Jan 16, 2022 · 1 comment

Comments

@vringar
Copy link
Contributor

vringar commented Jan 16, 2022

We currently log a call before we call the function.

return function () {
const callContext = getOriginatingScriptContext(logSettings.logCallStack);
logCall(
objectName + "." + methodName,
arguments,
callContext,
logSettings,
);
return func.apply(this, arguments);
};

This results in us being unable to capture the return value so we leave it empty.
const msg = {
operation: JSOperation.call,
symbol: instrumentedFunctionName,
args: serialArgs,
value: "",
scriptUrl: callContext.scriptUrl,
scriptLine: callContext.scriptLine,
scriptCol: callContext.scriptCol,
funcName: callContext.funcName,
scriptLocEval: callContext.scriptLocEval,
callStack: callContext.callStack,
ordinal: ordinal++,
};

Is there a reason we chose to do that?

@Giblin91
Copy link

Giblin91 commented Mar 24, 2023

Hi,

I am trying to capture the return value of some functions myself.
For what I saw, value is used for return of get() operations, but not for call() ones, but is used as "arg" for set() ones, which makes its usage a bit confusing.
immagine

From SQLite Documentation I see that MAX_LENGTH for String is 1 billion bytes. Maybe is related to a size problem? Although it can be stored and I cannot anticipate a return value of over 1 billion bytes, maybe storing this information would inflate the DB too much...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants