Quieten logging: move many info to debug

This commit is contained in:
Keith Edmunds 2024-07-30 16:51:53 +01:00
parent bd7fb79610
commit 0c76227bbc
4 changed files with 17 additions and 17 deletions

View File

@ -278,7 +278,7 @@ def normalise_track(path: str) -> None:
# Check type
ftype = os.path.splitext(path)[1][1:]
if ftype not in ["mp3", "flac"]:
log.info(
log.error(
f"helpers.normalise_track({path}): " f"File type {ftype} not implemented"
)

View File

@ -524,7 +524,7 @@ class Window(QMainWindow, Ui_MainWindow):
) -> Optional[Playlists]:
"""Create new playlist"""
log.info(f"create_playlist({playlist_name=}")
log.debug(f"create_playlist({playlist_name=}")
playlist_name = self.solicit_playlist_name(session)
if not playlist_name:
@ -575,7 +575,7 @@ class Window(QMainWindow, Ui_MainWindow):
self.move_source_rows = self.active_tab().get_selected_rows()
self.move_source_model = self.active_proxy_model()
log.info(f"cut_rows(): {self.move_source_rows=} {self.move_source_model=}")
log.debug(f"cut_rows(): {self.move_source_rows=} {self.move_source_model=}")
def debug(self):
"""Invoke debugger"""

View File

@ -329,7 +329,7 @@ class PlaylistModel(QAbstractTableModel):
with db.Session() as session:
for row_number in sorted(row_numbers, reverse=True):
log.info(f"{self}: delete_rows(), {row_number=}")
log.debug(f"{self}: delete_rows(), {row_number=}")
super().beginRemoveRows(QModelIndex(), row_number, row_number)
# We need to remove data from the underlying data store,
# which is the database, but we cache in
@ -480,7 +480,7 @@ class PlaylistModel(QAbstractTableModel):
(ie, ignore the first, not-yet-duplicate, track).
"""
log.info(f"{self}: get_duplicate_rows() called")
log.debug(f"{self}: get_duplicate_rows() called")
found = []
result = []
@ -494,7 +494,7 @@ class PlaylistModel(QAbstractTableModel):
else:
found.append(track_id)
log.info(f"{self}: get_duplicate_rows() returned: {result=}")
log.debug(f"{self}: get_duplicate_rows() returned: {result=}")
return result
def _get_new_row_number(self, proposed_row_number: Optional[int]) -> int:
@ -884,7 +884,7 @@ class PlaylistModel(QAbstractTableModel):
Move existing_rat track to new_row_number and append note to any existing note
"""
log.info(f"{self}: move_track_add_note({new_row_number=}, {existing_rat=}, {note=}")
log.debug(f"{self}: move_track_add_note({new_row_number=}, {existing_rat=}, {note=}")
if note:
with db.Session() as session:
@ -911,7 +911,7 @@ class PlaylistModel(QAbstractTableModel):
Add the existing_rat track details to the existing header at header_row_number
"""
log.info(f"{self}: move_track_to_header({header_row_number=}, {existing_rat=}, {note=}")
log.debug(f"{self}: move_track_to_header({header_row_number=}, {existing_rat=}, {note=}")
if existing_rat.track_id:
if note and existing_rat.note:
@ -925,7 +925,7 @@ class PlaylistModel(QAbstractTableModel):
and execute any found
"""
log.info(f"{self}: obs_scene_change({row_number=})")
log.debug(f"{self}: obs_scene_change({row_number=})")
# Check any headers before this row
idx = row_number - 1
@ -949,7 +949,7 @@ class PlaylistModel(QAbstractTableModel):
sceneName=scene_name
)
)
log.info(f"{self}: OBS scene changed to '{scene_name}'")
log.debug(f"{self}: OBS scene changed to '{scene_name}'")
continue
except obswebsocket.exceptions.ConnectionFailure:
log.error(f"{self}: OBS connection refused")
@ -964,7 +964,7 @@ class PlaylistModel(QAbstractTableModel):
- update display
"""
log.info(f"{self}: previous_track_ended()")
log.debug(f"{self}: previous_track_ended()")
# Sanity check
if not track_sequence.previous:
@ -999,7 +999,7 @@ class PlaylistModel(QAbstractTableModel):
Remove track from row, retaining row as a header row
"""
log.info(f"{self}: remove_track({row_number=})")
log.debug(f"{self}: remove_track({row_number=})")
with db.Session() as session:
playlist_row = session.get(

View File

@ -344,7 +344,7 @@ class PlaylistTab(QTableView):
else:
self.musicmuster.lblSumPlaytime.setText("")
else:
log.info(
log.debug(
f"playlists.py.selectionChanged: {self.musicmuster.disable_selection_timing=}"
)
@ -397,7 +397,7 @@ class PlaylistTab(QTableView):
else False.
"""
log.info(f"_audacity({cmd=})")
log.debug(f"_audacity({cmd=})")
# Notify user if audacity not running
if "audacity" not in [i.name() for i in psutil.process_iter()]:
@ -433,7 +433,7 @@ class PlaylistTab(QTableView):
log.error(f"_audactity_command {msgs=}")
return False
if timing:
log.info(f"_audactity_command {timing=}")
log.debug(f"_audactity_command {timing=}")
return True
@ -636,7 +636,7 @@ class PlaylistTab(QTableView):
"""
rows_to_delete = self.get_selected_rows()
log.info(f"_delete_rows({rows_to_delete=}")
log.debug(f"_delete_rows({rows_to_delete=}")
row_count = len(rows_to_delete)
if row_count < 1:
return
@ -775,7 +775,7 @@ class PlaylistTab(QTableView):
if status:
self.musicmuster.audacity_file_path = path
log.info(f"_open_in_audacity {path=}, {status=}")
log.debug(f"_open_in_audacity {path=}, {status=}")
def _rescan(self, row_number: int) -> None:
"""Rescan track"""