SymbiSoft / android-python27

Automatically exported from code.google.com/p/android-python27
0 stars 0 forks source link

com.android.pyton27.process.Process does not write log #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install and Run PythonAPK.apk
2. Check /sdcard/com.android.python27/hello.py.log

What is the expected output? What do you see instead?
The file exists, but is zero length. I expect to see output to be written here. 
In Process.java line 118, the instream gets written into the log file?

What version of the product are you using? On what operating system?
Nexus Galaxy, Android 4.0.4

Please provide any additional information below.

Original issue reported on code.google.com by adamli...@gmail.com on 14 Jun 2012 at 7:12

GoogleCodeExporter commented 8 years ago
There is a bug in com.trilead.ssh2.StreamGobbler. The code does not write what 
is left in the buffer when the steam is closed.

Original comment by adamli...@gmail.com on 25 Jun 2012 at 8:33

GoogleCodeExporter commented 8 years ago
I see, thanks for the finding. I think I have somewhere a working version of 
StreamGobbler, will try to replace.

Original comment by anthony....@gmail.com on 27 Jun 2012 at 9:04

GoogleCodeExporter commented 8 years ago
Any updates on this? I'm on a Galaxy Nexus with 4.2, and the log files aren't 
being written. It's quite a pain :|

Original comment by unnamedrambler@gmail.com on 8 Apr 2013 at 3:03

GoogleCodeExporter commented 8 years ago
Just use python logging (http://docs.python.org/2/library/logging.html) and 
don't rely on StreamGobbler.

Original comment by anthony....@gmail.com on 8 Apr 2013 at 3:06

GoogleCodeExporter commented 8 years ago
Yea, that's what I'm doing for app logging, but I'm interested in getting some 
backtraces from crashes that happen only in the APK not when I run it manually 
in adb shell.

Any idea how to see those?

Original comment by unnamedrambler@gmail.com on 8 Apr 2013 at 4:46

GoogleCodeExporter commented 8 years ago
I'm using:

Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler());

With MyExceptionHandler implements UncaughtExceptionHandler{...

And in uncaughtException I'm dumping the logcat (you need READ_LOGS permission 
in your manifest)

Original comment by anthony....@gmail.com on 8 Apr 2013 at 6:23