Skip to content

add new error message and improve existing #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pythonforandroid/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ def __getattr__(self, key):

class LevelDifferentiatingFormatter(logging.Formatter):
def format(self, record):
if record.levelno > 20:
if record.levelno > 30:
record.msg = '{}{}[ERROR]{}{}: '.format(
Err_Style.BRIGHT, Err_Fore.RED, Err_Fore.RESET,
Err_Style.RESET_ALL) + record.msg
elif record.levelno > 20:
record.msg = '{}{}[WARNING]{}{}: '.format(
Err_Style.BRIGHT, Err_Fore.RED, Err_Fore.RESET,
Err_Style.RESET_ALL) + record.msg
Expand All @@ -111,6 +115,7 @@ def format(self, record):
info = logger.info
debug = logger.debug
warning = logger.warning
error = logger.error


IS_PY3 = sys.version_info[0] >= 3
Expand Down Expand Up @@ -1008,7 +1013,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
'android-{}'.format(self.android_api),
platform_dir)
if not exists(self.ndk_platform):
warning('ndk_platform doesn\'t exist')
warning('ndk_platform doesn\'t exist: {}'.format(self.ndk_platform))
ok = False

py_platform = sys.platform
Expand Down Expand Up @@ -1065,6 +1070,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
executable))

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

def __init__(self):
Expand Down