Skip to content

Commit 7c274c3

Browse files
committed
add a way to force dumping the full log of a android command if it fail: P4A_FULL_DEBUG=1
1 parent d1e01b2 commit 7c274c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pythonforandroid/logger.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ def shprint(command, *args, **kwargs):
146146
kwargs["_err_to_out"] = True
147147
kwargs["_bg"] = True
148148
is_critical = kwargs.pop('_critical', False)
149-
tail_n = kwargs.pop('_tail', 0)
149+
tail_n = kwargs.pop('_tail', None)
150+
if "P4A_FULL_DEBUG" in os.environ:
151+
tail_n = 0
150152
filter_in = kwargs.pop('_filter', None)
151153
filter_out = kwargs.pop('_filterout', None)
152154
if len(logger.handlers) > 1:
@@ -193,7 +195,7 @@ def shprint(command, *args, **kwargs):
193195
stdout.write('{}\r{:>{width}}\r'.format(
194196
Err_Style.RESET_ALL, ' ', width=(columns - 1)))
195197
stdout.flush()
196-
if tail_n or filter_in or filter_out:
198+
if tail_n is not None or filter_in or filter_out:
197199
def printtail(out, name, forecolor, tail_n=0,
198200
re_filter_in=None, re_filter_out=None):
199201
lines = out.splitlines()

0 commit comments

Comments
 (0)