@@ -46,7 +46,7 @@ def to_description(
4646 map_results ,
4747 desc = "Extracting images" ,
4848 unit = "images" ,
49- disable = LOG .getEffectiveLevel () <= logging .DEBUG ,
49+ disable = LOG .isEnabledFor ( logging .DEBUG ) ,
5050 total = len (extractors ),
5151 )
5252 )
@@ -62,6 +62,8 @@ def run_extraction(cls, extractor: TImageExtractor) -> types.ImageMetadataOrErro
6262 try :
6363 return extractor .extract ()
6464 except exceptions .MapillaryDescriptionError as ex :
65+ if LOG .isEnabledFor (logging .DEBUG ):
66+ LOG .error (f"{ cls .__name__ } ({ image_path .name } ): { ex } " )
6567 return types .describe_error_metadata (
6668 ex , image_path , filetype = types .FileType .IMAGE
6769 )
@@ -112,7 +114,7 @@ def to_description(
112114 map_results ,
113115 desc = "Extracting videos" ,
114116 unit = "videos" ,
115- disable = LOG .getEffectiveLevel () <= logging .DEBUG ,
117+ disable = LOG .isEnabledFor ( logging .DEBUG ) ,
116118 total = len (extractors ),
117119 )
118120 )
@@ -128,6 +130,8 @@ def run_extraction(cls, extractor: TVideoExtractor) -> types.VideoMetadataOrErro
128130 try :
129131 return extractor .extract ()
130132 except exceptions .MapillaryDescriptionError as ex :
133+ if LOG .isEnabledFor (logging .DEBUG ):
134+ LOG .error (f"{ cls .__name__ } ({ video_path .name } ): { ex } " )
131135 return types .describe_error_metadata (
132136 ex , video_path , filetype = types .FileType .VIDEO
133137 )
0 commit comments