question

bodin avatar image
bodin asked

Cloud Script log.debug() not showing data?

Hi,

I'm learning how to use Cloud Script. my problem is I cannot output argument to log.debug

from this 2 lines of script:

return { input: args.inputValue };
log.debug("helloWorld:", { input: args.inputValue });

and I used game manager to run script with this argument

{"inputValue":3}


I got this return result
"FunctionResult":{"input": 3},
"Logs": [
        {
            "Level": "Debug",
            "Message": "helloWorld:",
            "Data": [
                [
                    []
                ]
            ]
        }


I don't understand why "inputValue" can be appeared in return message, but not in log.debug?

Doesn't it should be appeared in value for "Data" key?

Best regards,

Bodin

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bodin avatar image
bodin answered

ok, I got it now.

the "Data" part will show when I check it from Playsteam event.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Actually they should also show at the callback result. I have tested the log.debug just now and it works fine.

0 Likes 0 ·
bodin avatar image bodin Seth Du ♦ commented ·

Hi @SethDu,

Thank you for helping me checking this.


I tested again, Key "Data" still not show up in Log part.

0 Likes 0 ·
capture.jpg (70.1 KiB)
bodin avatar image
bodin answered

but if I view a raw JSON from Playstream, it's shows up normally.


capture.jpg (62.6 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

I did more tests and I believe there is a display issue on the CloudScript tab of Player page. This occurs when the data value field is a JSON object like:

log.debug("helloWorld:", { input: args.inputValue });

or

log.debug("helloWorld:", { "testkey": "testvalue" });

if you input a string or stringified JSON object, there won't be any issue.

log.debug("helloWorld:", "{\"testkey\":\"testvalue\"}");

I will inform our team to investigate this display issue.

1 Like 1 ·
bodin avatar image bodin Seth Du ♦ commented ·

noted & thank you very much.
It would be nice if this issue can be fixed.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.