Skip to content

LoggingCategory

Qt Base Class: QLoggingCategory

Signature: QLoggingCategory(self, category: bytes, severityLevel: PySide6.QtCore.QtMsgType = Instance(PySide6.QtCore.QtMsgType.QtDebugMsg)) -> None

Base classes

Name Children Inherits
QLoggingCategory
PySide6.QtCore
QLoggingCategory(self, category: bytes, severityLevel: PySide6.QtCore.QtMsgType \= Instance(PySide6.QtCore.QtMsgType.QtDebugMsg)) -> None

⋔ Inheritance diagram

graph TD
  1473299719376["core.LoggingCategory"]
  1473243837904["QtCore.QLoggingCategory"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473243837904 --> 1473299719376
  1473291690208 --> 1473243837904
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QLoggingCategory

Represents a category, or 'area' in the logging infrastructure.

Source code in prettyqt\core\loggingcategory.py
class LoggingCategory(QtCore.QLoggingCategory):
    """Represents a category, or 'area' in the logging infrastructure."""

    def get_level(self) -> MsgTypeStr:
        if self.isDebugEnabled():
            return "debug"
        elif self.isInfoEnabled():
            return "info"
        elif self.isWarningEnabled():
            return "warning"
        elif self.isCriticalEnabled():
            return "critical"
        else:
            return "fatal"

    def set_enabled(
        self,
        level: MsgTypeStr,
    ):
        self.setEnabled(MSG_TYPE[level], True)

    def set_disabled(self, level: MsgTypeStr):
        self.setEnabled(MSG_TYPE[level], False)