def doLog( wichObject: 'Model', level: int, message: str, source: str = UNKNOWN, avoidDuplicates: bool = True ) -> None: logger.debug('%s %s %s', wichObject, level, message) logManager().doLog(wichObject, level, message, source, avoidDuplicates)
def getLogs(wichObject, limit=None): ''' Get the logs associated with "wichObject", limiting to "limit" (default is GlobalConfig.MAX_LOGS_PER_ELEMENT) ''' from uds.core.util.Config import GlobalConfig if limit is None: limit = GlobalConfig.MAX_LOGS_PER_ELEMENT.getInt() return logManager().getLogs(wichObject, limit)
def getLogs(wichObject: 'Model', limit: typing.Optional[int] = None) -> typing.List[typing.Dict]: """ Get the logs associated with "wichObject", limiting to "limit" (default is GlobalConfig.MAX_LOGS_PER_ELEMENT) """ from uds.core.util.config import GlobalConfig if limit is None: limit = GlobalConfig.MAX_LOGS_PER_ELEMENT.getInt() return logManager().getLogs(wichObject, limit)
def clearLogs(wichObject): ''' Clears the logs associated with the object using the logManager ''' return logManager().clearLogs(wichObject)
def doLog(wichObject, level, message, source=UNKNOWN, avoidDuplicates=True): logger.debug('{} {} {}'.format(wichObject, level, message)) logManager().doLog(wichObject, level, message, source, avoidDuplicates)
def clearLogs(wichObject: 'Model') -> None: """ Clears the logs associated with the object using the logManager """ return logManager().clearLogs(wichObject)