Exemple #1
0
 def __toggle_debug_logging(self):
     """
     Toggles global debug logging on and off in the log manager.
     This will affect all logging across all of toolkit.
     """
     # flip debug logging
     LogManager().global_debug = not LogManager().global_debug
Exemple #2
0
    def __toggle_debug_logging(self):
        """
        Toggles global debug logging on and off in the log manager.
        This will affect all logging across all of toolkit.
        """
        self.logger.debug("calling substance painer with debug: %s" %
                          LogManager().global_debug)

        # flip debug logging
        LogManager().global_debug = not LogManager().global_debug
        if self.app:
            self.app.toggle_debug_logging(LogManager().global_debug)
Exemple #3
0
    def __open_log_folder(self):
        """
        Opens the file system folder where log files are being stored.
        """
        self.log_info("Log folder location: '%s'" % LogManager().log_folder)

        if self.has_ui:
            # only import QT if we have a UI
            from sgtk.platform.qt import QtGui, QtCore

            url = QtCore.QUrl.fromLocalFile(LogManager().log_folder)
            status = QtGui.QDesktopServices.openUrl(url)
            if not status:
                self._engine.log_error("Failed to open folder!")
Exemple #4
0
# when Rumba software version is above the tested one.
SHOW_COMP_DLG = "SGTK_COMPATIBILITY_DIALOG_SHOWN"

# this is the absolute minimum Rumba version for the engine to work. Actually
# the one the engine was developed originally under, so change it at your
# own risk if needed.
MIN_COMPATIBILITY_VERSION = 1.1

# this is a place to put our persistent variables between different documents
# opened
if not hasattr(rumba, "shotgun"):
    rumba.shotgun = lambda: None

# Although the engine has logging already, this logger is needed for logging
# where an engine may not be present.
logger = LogManager.get_logger(__name__)
logger.debug("Loading engine module...")


# detects if the application has be run in batch mode or not
def is_batch_mode():
    return rumbapy.args().no_gui


# logging functionality
def show_error(msg):
    from PySide2.QtWidgets import QMessageBox

    if not is_batch_mode():
        QMessageBox.critical(None, "Shotgun Error | %s engine" % APPLICATION_NAME, msg)
    else:
Exemple #5
0
def get_logger():
    # This is present for backwards compatibility with older tk-core's.
    # Lazy import to avoid poluting the module's namespace.
    import tank.authentication
    from tank.log import LogManager
    return LogManager.get_logger(tank.authentication.__name__)