asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

Add a GO "Log" method that executes "console.log" #6

Closed deepch closed 7 years ago

deepch commented 7 years ago

I suggest adding console.log() output stdout and stderr from golang if this would be possible then debugging would be easier.

In my case, I have a problem in the finished package but I do not have it go run *.go and without writing processing I will not understand where it is, if it was part of astilectron options.

asticode commented 7 years ago

@deepch do you need a Log() method in GO that would execute console.log() in JS ? Is that it ?

deepch commented 7 years ago

yes

asticode commented 7 years ago

will do

asticode commented 7 years ago

@deepch I've added a GO window.Log(message string) error method. Here's what you need to do in order to use it:

$ cd $GOPATH/src/github.com/asticode/go-astilectron-bundler
$ make
$ cd <your project path>
$ go get -u ./...
w.Log("my log message")

Does that fix your problem and can we close this issue?

nkbai commented 5 years ago

is console.log redirect to stdout or stderr?

asticode commented 5 years ago

console.log should redirect to stdout