I am calling Golang library from Android like that and would like to 
capture stdout/stderr from my: `Somemodule.functionToCall`.

I was wondering if there is any way to capture the console output. 

I am not sure if there is anything builtin to Gomobile that I could use.

I see two potential options:
- capture the stdout/stderr already on the golang level and add the output 
as a part of the MethodResult,

- capture the stdout/stderr somehow on the Android level? Not really sure 
if that's possible though

```
private fun rpcCallBackgroundResult(rpcMethod: String?, jsonArguments : 
String?, result: MethodChannel.Result) {
    object : AsyncTask<Void?, Void?, Void?>() {
        override fun doInBackground(vararg params: Void?): Void? {

            // Here is the call - I would like to capture stdout/stderr
            val response: MethodResult = Somemodule.functionToCall(param1, 
param2)
            / End

            result.success(response.getOutput())
            return null
        }
    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
}
```



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/205ffa07-df69-4576-ae2b-bc8dc4f1cff3n%40googlegroups.com.

Reply via email to