Skip to content

Commit b5f30a8

Browse files
committed
show error if prepare_build_environment not ok
1 parent 069ce7c commit b5f30a8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pythonforandroid/toolchain.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ def __getattr__(self, key):
8585

8686
class LevelDifferentiatingFormatter(logging.Formatter):
8787
def format(self, record):
88-
if record.levelno > 20:
88+
if record.levelno > 30:
89+
record.msg = '{}{}[ERROR]{}{}: '.format(
90+
Err_Style.BRIGHT, Err_Fore.RED, Err_Fore.RESET,
91+
Err_Style.RESET_ALL) + record.msg
92+
elif record.levelno > 20:
8993
record.msg = '{}{}[WARNING]{}{}: '.format(
9094
Err_Style.BRIGHT, Err_Fore.RED, Err_Fore.RESET,
9195
Err_Style.RESET_ALL) + record.msg
@@ -111,6 +115,7 @@ def format(self, record):
111115
info = logger.info
112116
debug = logger.debug
113117
warning = logger.warning
118+
error = logger.error
114119

115120

116121
IS_PY3 = sys.version_info[0] >= 3
@@ -1065,6 +1070,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
10651070
executable))
10661071

10671072
if not ok:
1073+
error('{}python-for-android cannot continue; aborting{}'.format(Err_Fore.RED, Err_Fore.RESET))
10681074
sys.exit(1)
10691075

10701076
def __init__(self):

0 commit comments

Comments
 (0)