Skip to content

Commit a2963fa

Browse files
committed
logging: use beets logger in more places
This was leading to crashes due to the beets log formatting infra not being in place.
1 parent 2fc9408 commit a2963fa

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

beets/importer/stages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
from __future__ import annotations
1616

1717
import itertools
18-
import logging
1918
from typing import TYPE_CHECKING, Callable
2019

21-
from beets import config, plugins
20+
from beets import config, logging, plugins
2221
from beets.util import MoveOperation, displayable_path, pipeline
2322

2423
from .tasks import (

beets/importer/state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414

1515
from __future__ import annotations
1616

17-
import logging
1817
import os
1918
import pickle
2019
from bisect import bisect_left, insort
2120
from dataclasses import dataclass
2221
from typing import TYPE_CHECKING
2322

24-
from beets import config
23+
from beets import config, logging
2524

2625
if TYPE_CHECKING:
2726
from beets.util import PathBytes

beets/importer/tasks.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from __future__ import annotations
1616

17-
import logging
1817
import os
1918
import re
2019
import shutil
@@ -26,7 +25,7 @@
2625

2726
import mediafile
2827

29-
from beets import autotag, config, library, plugins, util
28+
from beets import autotag, config, library, logging, plugins, util
3029
from beets.dbcore.query import PathQuery
3130

3231
from .state import ImportState
@@ -36,9 +35,6 @@
3635

3736
from .session import ImportSession
3837

39-
# Global logger.
40-
log = logging.getLogger(__name__)
41-
4238

4339
SINGLE_ARTIST_THRESH = 0.25
4440

beetsplug/convert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
"""Converts tracks or albums to external directory"""
1616

17-
import logging
1817
import os
1918
import shlex
2019
import subprocess
@@ -25,7 +24,7 @@
2524
import mediafile
2625
from confuse import ConfigTypeError, Optional
2726

28-
from beets import art, config, plugins, ui, util
27+
from beets import art, config, logging, plugins, ui, util
2928
from beets.library import Item, parse_query_string
3029
from beets.plugins import BeetsPlugin
3130
from beets.util import par_map

beetsplug/discogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
import beets
3939
import beets.ui
40-
from beets import config
40+
from beets import config, logging
4141
from beets.autotag.distance import string_dist
4242
from beets.autotag.hooks import AlbumInfo, TrackInfo
4343
from beets.metadata_plugins import MetadataSourcePlugin

0 commit comments

Comments
 (0)