Skip to content

Commit 6a00269

Browse files
committed
Print option name with error msg
1 parent e4219af commit 6a00269

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/fosslight_android/_src_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def find_item_to_analyze(bin_info, output_path, start_time="", path_to_exclude=[
5454
if source_path == analyzed_path and item_license == CONST_NULL:
5555
item.set_license(analyzed_license)
5656
except Exception as error:
57-
logger.debug(f"failed to update license from src analysis:{error}")
57+
logger.debug(f"Failed to update license from src analysis:{error}")
5858

5959
return bin_info
6060

src/fosslight_android/android_binary_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def main():
846846

847847
read_success, android_log_lines = read_file(ANDROID_LOG_FILE_NAME)
848848
if not read_success:
849-
logger.error("Fail to read a file:" + ANDROID_LOG_FILE_NAME)
849+
logger.error("(-a option) Fail to read a file:" + ANDROID_LOG_FILE_NAME)
850850
sys.exit(1)
851851
else:
852852
set_env_variables_from_result_log()

src/fosslight_android/check_notice_file.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_notice_html_checklist(binary_file, check_type, notice_file):
4242
except IOError:
4343
logger.info(CANNOT_FIND_MSG)
4444
else:
45-
logger.info("Fail to read a binary file:" + binary_file)
45+
logger.info(f"Fail to read a binary file: {binary_file}")
4646
return notice_file_list
4747

4848

@@ -280,22 +280,22 @@ def get_binary_notice_text(binary_file_array, notice_file_path):
280280
def divide_notice_files_by_binary(notice_file_to_divide, result_file_path, now):
281281
read_success, contents = read_file(notice_file_to_divide, True)
282282
if read_success:
283-
dir_name = "NOTICE_FILES_" + now
283+
dir_name = f"NOTICE_FILES_{now}"
284284
dir_name = os.path.join(result_file_path, dir_name)
285285
try:
286286
if not os.path.exists(dir_name):
287287
os.makedirs(dir_name)
288288
else:
289-
logger.warn(dir_name + " folder already exists.")
289+
logger.warn(f"{dir_name} folder already exists.")
290290
except OSError:
291-
logger.warn("Cannot create " + dir_name + " folder.")
291+
logger.warn(f"Cannot create {dir_name} folder.")
292292
return
293293
os.chdir(dir_name)
294294
items = parsing_notice_html_for_license_text(contents)
295295
create_license_txt_files(items, "")
296-
logger.warn(dir_name + " folder has been created.")
296+
logger.warn(f"{dir_name} folder has been created.")
297297
else:
298-
logger.warn("Failed to read :" + notice_file_to_divide)
298+
logger.warn(f"Failed to read: {notice_file_to_divide}")
299299

300300

301301
def create_license_txt_files(file_list, result_file_path):

0 commit comments

Comments
 (0)