예제 #1
0
def nvdaControllerInternal_logMessage(pid,tid,level,fileName,funcName,lineNo,message):
	if not log.isEnabledFor(level):
		return 0
	from appModuleHandler import getAppNameFromProcessID
	codepath="RPC: %s, %s, %s, line %d"%(getAppNameFromProcessID(pid,includeExt=True),fileName,funcName, lineNo)
	log._log(level,message,[],codepath=codepath)
	return 0
예제 #2
0
파일: manager.py 프로젝트: tsengwoody/nvda
def _speechManagerDebug(msg, *args, **kwargs) -> None:
    """Log 'msg % args' with severity 'DEBUG' if speech manager logging is enabled.
		'SpeechManager-' is prefixed to all messages to make searching the log easier.
	"""
    if not log.isEnabledFor(log.DEBUG) or not _shouldDoSpeechManagerLogging():
        return
    log._log(log.DEBUG, f"SpeechManager- " + msg, args, **kwargs)
예제 #3
0
파일: manager.py 프로젝트: sup4r/nvda
def _speechManagerUnitTest(msg, *args, **kwargs) -> None:
    """Log 'msg % args' with severity 'DEBUG' if .
		'SpeechManUnitTest-' is prefixed to all messages to make searching the log easier.
		When
	"""
    if not IS_UNIT_TEST_LOG_ENABLED:
        return _speechManagerDebug(msg, *args, **kwargs)
    log._log(log.INFO, f"SpeechManUnitTest- " + msg, args, **kwargs)
예제 #4
0
def louis_log(level, message):
    if not _isDebug():
        return
    NVDALevel = LOUIS_TO_NVDA_LOG_LEVELS.get(level, log.DEBUG)
    if not log.isEnabledFor(NVDALevel):
        return
    message = message.decode("ASCII")
    codepath = "liblouis at internal log level %d" % level
    log._log(NVDALevel, message, [], codepath=codepath)
예제 #5
0
def louis_log(level, message):
	if not _isDebug():
		return
	NVDALevel = LOUIS_TO_NVDA_LOG_LEVELS.get(level, log.DEBUG)
	if not log.isEnabledFor(NVDALevel):
		return
	message = message.decode("ASCII")
	codepath = "liblouis at internal log level %d" % level
	log._log(NVDALevel, message, [], codepath=codepath)
예제 #6
0
파일: NVDAHelper.py 프로젝트: bramd/nvda
def nvdaControllerInternal_logMessage(level,pid,message):
	if not log.isEnabledFor(level):
		return 0
	if pid:
		from appModuleHandler import getAppNameFromProcessID
		codepath="RPC process %s (%s)"%(pid,getAppNameFromProcessID(pid,includeExt=True))
	else:
		codepath="NVDAHelperLocal"
	log._log(level,message,[],codepath=codepath)
	return 0
예제 #7
0
파일: NVDAHelper.py 프로젝트: rpaquay/nvda
def nvdaControllerInternal_logMessage(level,pid,message):
	if not log.isEnabledFor(level):
		return 0
	if pid:
		from appModuleHandler import getAppNameFromProcessID
		codepath="RPC process %s (%s)"%(pid,getAppNameFromProcessID(pid,includeExt=True))
	else:
		codepath="NVDAHelperLocal"
	log._log(level,message,[],codepath=codepath)
	return 0
예제 #8
0
파일: manager.py 프로젝트: tsengwoody/nvda
def _speechManagerUnitTest(msg, *args, **kwargs) -> None:
    """Log 'msg % args' with severity 'DEBUG' if .
		'SpeechManUnitTest-' is prefixed to all messages to make searching the log easier.
		When
	"""
    if not IS_UNIT_TEST_LOG_ENABLED:
        # Don't reuse _speechManagerDebug, it leads to incorrect function names in the log (all
        # SpeechManager debug logging appears to come from _speechManagerUnitTest instead of the frame
        # one stack higher. The codepath argument for _log could also be used to resolve this, but duplication
        # simpler.
        if log.isEnabledFor(log.DEBUG) and _shouldDoSpeechManagerLogging():
            log._log(log.DEBUG, f"SpeechManager- " + msg, args, **kwargs)
        return
    log._log(log.INFO, f"SpeechManUnitTest- " + msg, args, **kwargs)