Skip to content

chore: stringify console log arguments - #1185

Closed
pravusjif wants to merge 2 commits into
mainfrom
chore/stringify-console-log-arguments
Closed

chore: stringify console log arguments#1185
pravusjif wants to merge 2 commits into
mainfrom
chore/stringify-console-log-arguments

Conversation

@pravusjif

@pravusjif pravusjif commented Jul 31, 2025

Copy link
Copy Markdown
Member

Added console log wrapper to stringify arguments, to avoid printing Object object on those cases.

With this change, if a scene code calls console.log(whateverObject) it doesn't print Object object anymore.

When putting the arg in an inline string, it will still need the JSON.Stringify() because as as soon as the object is included as: 'print object: ${whateverObject}' it gets automatically casted to String by Javascript and Javascript always stringifies objects as "Object object".

@pravusjif pravusjif self-assigned this Jul 31, 2025
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2025

Copy link
Copy Markdown

Deploying js-sdk-toolchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: a45580e
Status: ✅  Deploy successful!
Preview URL: https://033d8293.js-sdk-toolchain.pages.dev
Branch Preview URL: https://chore-stringify-console-log.js-sdk-toolchain.pages.dev

View logs

@github-actions

github-actions Bot commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/stringify-console-log-arguments/dcl-sdk-7.9.3-16651985932.commit-95a9dfa.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/stringify-console-log-arguments/dcl-sdk-commands-7.9.3-16651985932.commit-95a9dfa.tgz"
    npx $SDK_COMMANDS init
  • The @dcl/inspector package can be tested by visiting this url

    • Or by installing it via NPM
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/chore/stringify-console-log-arguments/@dcl/inspector/dcl-inspector-7.9.3-16651985932.commit-95a9dfa.tgz"
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/chore/stringify-console-log-arguments-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=chore/stringify-console-log-arguments

@pravusjif

Copy link
Copy Markdown
Member Author

Will do the same on Explorer side

@pravusjif pravusjif closed this Jul 31, 2025
@pravusjif
pravusjif deleted the chore/stringify-console-log-arguments branch July 31, 2025 17:14
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

Successfully merging this pull request may close these issues.

1 participant