mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
fixed log viewer model
This commit is contained in:
parent
b66c3c7b3d
commit
cc06b0e2cd
1 changed files with 10 additions and 6 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import collections
|
||||
from Qt import QtCore, QtGui
|
||||
from pype.api import Logger
|
||||
from pype.lib.log import _bootstrap_mongo_log, LOG_COLLECTION_NAME
|
||||
from pype.lib.log import PypeLogger
|
||||
|
||||
log = Logger().get_logger("LogModel", "LoggingModule")
|
||||
log = PypeLogger().get_logger("LogModel", "LoggingModule")
|
||||
|
||||
|
||||
class LogModel(QtGui.QStandardItemModel):
|
||||
|
|
@ -44,9 +43,14 @@ class LogModel(QtGui.QStandardItemModel):
|
|||
self.dbcon = None
|
||||
|
||||
# Crash if connection is not possible to skip this module
|
||||
database = _bootstrap_mongo_log()
|
||||
if LOG_COLLECTION_NAME in database.list_collection_names():
|
||||
self.dbcon = database[LOG_COLLECTION_NAME]
|
||||
if not PypeLogger.initialized:
|
||||
PypeLogger.initialize()
|
||||
|
||||
connection = PypeLogger.get_log_mongo_connection()
|
||||
if connection:
|
||||
PypeLogger.bootstrap_mongo_log()
|
||||
database = connection[PypeLogger.log_database_name]
|
||||
self.dbcon = database[PypeLogger.log_collection_name]
|
||||
|
||||
def headerData(self, section, orientation, role):
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue