Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Log prints functions as undefined #1915

Open
EibrielInv opened this issue Jan 8, 2021 · 1 comment
Open

Log prints functions as undefined #1915

EibrielInv opened this issue Jan 8, 2021 · 1 comment
Labels
bug Something isn't working SDK

Comments

@EibrielInv
Copy link

EibrielInv commented Jan 8, 2021

The following code return the log:

undefined
undefined
Test

but should be something like:

function()
function()
Test

Code:

function test() {log("Test")}

class myClass {
    constructor(){}

    func(a){
        log(a)
        a()
    }
}

log(test)

const mc = new myClass()
mc.func(test)

decentraland-ecs 6.6.3

@nchamo nchamo added bug Something isn't working SDK labels Jan 11, 2021
@menduz
Copy link
Member

menduz commented Jan 11, 2021

It is not a bug, log can only be used to print JSON-serializable values.

We could add it to the documentation though https://github.com/decentraland/explorer/blob/master/kernel/packages/decentraland-ecs/src/ecs/helpers.ts#L6-L33

any loggable parameter is not clear enough.

@menduz menduz closed this as completed Jan 11, 2021
@menduz menduz reopened this Jan 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working SDK
Projects
None yet
Development

No branches or pull requests

3 participants