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
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)
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)
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)
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
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)