nexxT.services.gui.GuiLogger module

This module provides the gui logging service for nexxT.

class nexxT.services.gui.GuiLogger.GuiLogger[source]

Bases: ConsoleLogger

Logging service in GUI mode.

__init__(self, /, parent: PySide6.QtCore.QObject | None = None, *, objectName: str | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

detach()[source]

This slot is called when the service is removed from the framework

removeHandler()[source]

Remove logging handler from python logging system.

setLogLevel()[source]

Sets the current log level from the calling action.

Returns:

None

setNumEntries()[source]

Sets the number of displayed log entries from the calling action.

staticMetaObject = PySide6.QtCore.QMetaObject("GuiLogger" inherits "ConsoleLogger": Methods:   #5 type=Slot, signature=detach() )
class nexxT.services.gui.GuiLogger.LogHandler(logView)[source]

Bases: Handler

Python logging handler which passes python log records to the gui.

__init__(logView)[source]

Initializes the instance - basically setting the formatter to None and the filter list to empty.

emit(record)[source]

called when a new log record is created

Parameters:

record – a log record instance (see python docs)

Returns:

class nexxT.services.gui.GuiLogger.LogView[source]

Bases: QTableView

Class implementing the GUI log display.

class LogModel[source]

Bases: QAbstractItemModel

Model/view model for log entries. The entries are held in a python list.

__init__(self, /, parent: PySide6.QtCore.QObject | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

clear()[source]

removes all entries from the list

Returns:

None

columnCount(parent)[source]

Overwritten from QAbstractItemModel

Parameters:

parent – a QModelIndex instance

Returns:

the number of columns (constant)

data(modelIndex, role)[source]

Overwritten from QAbstractItemModel

Parameters:
  • modelIndex – a QModelIndex instance

  • role – the role

Returns:

the requested data

headerData(section, orientation, role)[source]

Overwritten from QAbstractItemModel

Parameters:
  • section – the section index

  • orientation – the orientation

  • role – the item role

Returns:

the section label

index(row, column, parent)[source]

Overwritten from QAbstractItemModel

Parameters:
  • row – integer

  • column – integer

  • parent – a QModelIndex instance

Returns:

a QModelIndex for the specified item

parent(index)[source]

Overwritten from QAbstractItemModel

Parameters:

index

Returns:

invalid model index (because we have a 2D table)

rowCount(parent)[source]

Overwritten from QAbstractItemModel

Parameters:

parent – a QModelIndex instance

Returns:

number of log entries

setSingleLineMode(enabled)[source]

called from the table view to indicate single line mode (in this mode only the last line of a log message is displayed.

Parameters:

enabled – boolean

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("LogModel" inherits "QAbstractItemModel": )
update(queue)[source]

add queued items to model

Parameters:

queue – a python Queue instance

Returns:

None

__init__(self, /, parent: PySide6.QtWidgets.QWidget | None = None, *, showGrid: bool | None = None, gridStyle: PySide6.QtCore.Qt.PenStyle | None = None, sortingEnabled: bool | None = None, wordWrap: bool | None = None, cornerButtonEnabled: bool | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

addLogRecord(items)[source]

Add a log record to the synchronized queue

Parameters:

items – a tuple of (timestamp[str], level[int], message[str], modulename[str], filename[str], lineno[int])

Returns:

None

changeEvent(event)[source]

This for instance happens when the style sheet changed. It may affect the calculated row height. So invalidate:

Parameters:

event – the event causing the change

Returns:

clear()[source]

Clears the view

Returns:

None

setFollow(follow)[source]

set follow mode

Parameters:

follow – a boolean

Returns:

None

setUniformRowHeights(enabled)[source]

Takeover from QTreeView, see also here https://stackoverflow.com/questions/50943356/qtableview-performance

Parameters:

enabled

Returns:

sizeHintForRow(row)[source]

return a size hint for the given row index

Parameters:

row – the row index as integer

Returns:

the height of the row as integer

staticMetaObject = PySide6.QtCore.QMetaObject("LogView" inherits "QTableView": )
update()[source]

Called periodically to synchronize model with added log records

Returns:

None