Skip to content

Commit

Permalink
fix: Adds logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hui committed Nov 27, 2023
1 parent b2e308a commit 48066df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PyHa/IsoAutio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ def generate_automated_labels_tweetynet(
except KeyboardInterrupt:
exit("Keyboard interrupt")
except Exception as exp:
logger.exception("Failed to load!")
logger.exception(f"Failed to load {audio_file}, parameters: {isolation_parameters}")
checkVerbose("Failed to load " + audio_file, isolation_parameters)
continue

Expand All @@ -1086,8 +1086,9 @@ def generate_automated_labels_tweetynet(
SAMPLE_RATE = normalized_sample_rate
except KeyboardInterrupt:
exit("Keyboard interrupt")
except:
except Exception as exc:
checkVerbose("Failed to Downsample " + audio_file, isolation_parameters)
logger.exception(f'Failed to downsample {audio_file}, parameters: {isolation_parameters}')

# convert stereo to mono if needed
# Might want to compare to just taking the first set of data.
Expand All @@ -1102,6 +1103,7 @@ def generate_automated_labels_tweetynet(
except BaseException as e:
checkVerbose("Error in detection, skipping " + audio_file, isolation_parameters)
print(e)
logger.exception(f'Error in detection, skipping {audio_file}, parameters: {isolation_parameters}')
continue

try:
Expand Down

0 comments on commit 48066df

Please sign in to comment.