Skip to content

Commit

Permalink
fix: not logging source as a list of string (#116)
Browse files Browse the repository at this point in the history
* fix: not logging source as a list of string

* fix: remove unused import
  • Loading branch information
paulfouquet authored Aug 29, 2022
1 parent e27f2d0 commit a871935
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/cli/cli_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def format_source(source: List[str]) -> List[str]:
source_json: List[str] = json.loads(source[0])
return source_json
except json.JSONDecodeError as e:
get_log().debug("Decoding Json Failed", source=source, msg=e)
get_log().debug("Decoding Json Failed", msg=e)
return source


Expand Down
4 changes: 2 additions & 2 deletions scripts/create_polygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def main() -> None:

output_files.append(temp_file_path)
except Exception as e: # pylint:disable=broad-except
get_log().error("create_polygon_file_skipped", path=file, error=str(e))
get_log().error("create_polygon_file_skipped", file=file, error=str(e))
is_error = True

with open("/tmp/file_list.json", "w", encoding="utf-8") as jf:
json.dump(output_files, jf)

get_log().info("create_polygons_end", source=source, duration=time_in_ms() - start_time)
get_log().info("create_polygons_end", duration=time_in_ms() - start_time)
if is_error:
get_log().info("create_polygons_warn", warning="At least one file has been skipped")
sys.exit(1)
Expand Down
5 changes: 3 additions & 2 deletions scripts/non_visual_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run(self) -> None:
def non_visual_qa(files: List[str]) -> None:
start_time = time_in_ms()

get_log().info("non_visual_qa_start", source=files)
get_log().info("non_visual_qa_start")

# Get srs
gdalsrsinfo_command = ["gdalsrsinfo", "-o", "wkt", "EPSG:2193"]
Expand All @@ -140,6 +140,7 @@ def non_visual_qa(files: List[str]) -> None:
if not is_tiff(file):
get_log().trace("non_visual_qa_file_not_tiff_skipped", file=file)
continue
get_log().info(f"Non Visual QA {file}", file=file)
file_check = FileCheck(file, srs)
file_check.run()

Expand All @@ -148,7 +149,7 @@ def non_visual_qa(files: List[str]) -> None:
else:
get_log().info("non_visual_qa_passed", file=file_check.path)

get_log().info("non_visual_qa_end", source=files, duration=time_in_ms() - start_time)
get_log().info("non_visual_qa_end", duration=time_in_ms() - start_time)


def main() -> None:
Expand Down
6 changes: 3 additions & 3 deletions scripts/standardising.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def start_standardising(files: List[str], preset: str, concurrency: int) -> List
tiff_files = []
output_files = []

get_log().info("standardising_start", source=files)
get_log().info("standardising_start")

for file in files:
if is_tiff(file):
Expand All @@ -32,15 +32,15 @@ def start_standardising(files: List[str], preset: str, concurrency: int) -> List
p.close()
p.join()

get_log().info("standardising_end", source=files, duration=time_in_ms() - start_time)
get_log().info("standardising_end", duration=time_in_ms() - start_time)

return output_files


def standardising(file: str, preset: str) -> str:
output_folder = "/tmp/"

get_log().info("standardising_start", source=file)
get_log().info(f"standardising {file}", source=file)

_, src_file_path = parse_path(file)
standardized_file_name = f"{get_file_name_from_path(src_file_path)}.tiff"
Expand Down

0 comments on commit a871935

Please sign in to comment.