Skip to content

Commit

Permalink
fix name of the loggers used (iterative#10085)
Browse files Browse the repository at this point in the history
__name__ looks something like `dvc.commands.diff`, but if we are already instantiating
root logger with `dvc`, it adds up to create something like `dvc.dvc.commands.diff`.

We should be using a root logger here instead.
  • Loading branch information
skshetry authored Nov 10, 2023
1 parent 0def298 commit b2fc194
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dvc/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"".encode("idna")


logger = logger.getChild(__name__)


class DvcParserError(Exception):
"""Base class for CLI parser errors."""

Expand Down
2 changes: 1 addition & 1 deletion dvc/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class LoggerWithTrace(logging.Logger):
trace = logging.debug


logger: "LoggerWithTrace" = logging.getLogger("dvc") # type: ignore[assignment]
logger: "LoggerWithTrace" = logging.getLogger() # type: ignore[assignment]

0 comments on commit b2fc194

Please sign in to comment.