Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions python/tank/platform/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import pprint
import traceback
import inspect
import warnings
import weakref
import threading

Expand Down Expand Up @@ -1302,6 +1303,14 @@ def log_debug(self, msg):

:param msg: Message to log.
"""

warnings.warn(
"The `Engine.log_debug` method is deprecated and will be removed "
"at any time after 2026-01. Use `Engine.logger` instead",
DeprecationWarning,
stacklevel=2
)
Comment on lines +1307 to +1312
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation warning message is duplicated across all five logging methods. Consider extracting this into a constant or helper function to improve maintainability and ensure consistency.

Copilot uses AI. Check for mistakes.

if not self.__has_018_logging_support() and self.__log_handler.inside_dispatch:
# special case: We are in legacy mode and all log messages are
# dispatched to the log_xxx methods because this engine does not have an
Expand All @@ -1326,6 +1335,14 @@ def log_info(self, msg):

:param msg: Message to log.
"""

warnings.warn(
"The `Engine.log_info` method is deprecated and will be removed "
"at any time after 2026-01. Use `Engine.logger` instead",
DeprecationWarning,
stacklevel=2
)

if not self.__has_018_logging_support() and self.__log_handler.inside_dispatch:
# special case: We are in legacy mode and all log messages are
# dispatched to the log_xxx methods because this engine does not have an
Expand All @@ -1350,6 +1367,14 @@ def log_warning(self, msg):

:param msg: Message to log.
"""

warnings.warn(
"The `Engine.log_warning` method is deprecated and will be removed "
"at any time after 2026-01. Use `Engine.logger` instead",
DeprecationWarning,
stacklevel=2
)

if not self.__has_018_logging_support() and self.__log_handler.inside_dispatch:
# special case: We are in legacy mode and all log messages are
# dispatched to the log_xxx methods because this engine does not have an
Expand All @@ -1374,6 +1399,14 @@ def log_error(self, msg):

:param msg: Message to log.
"""

warnings.warn(
"The `Engine.log_error` method is deprecated and will be removed "
"at any time after 2026-01. Use `Engine.logger` instead",
DeprecationWarning,
stacklevel=2
)

if not self.__has_018_logging_support() and self.__log_handler.inside_dispatch:
# special case: We are in legacy mode and all log messages are
# dispatched to the log_xxx methods because this engine does not have an
Expand All @@ -1398,6 +1431,14 @@ def log_exception(self, msg):

:param msg: Message to log.
"""

warnings.warn(
"The `Engine.log_exception` method is deprecated and will be removed "
"at any time after 2026-01. Use `Engine.logger` instead",
DeprecationWarning,
stacklevel=2
)

if not self.__has_018_logging_support() and self.__log_handler.inside_dispatch:
# special case: We are in legacy mode and all log messages are
# dispatched to the log_xxx methods because this engine does not have an
Expand Down
Loading