Module logHandler
[hide private]

Module logHandler

source code

Utilities and classes to manage logging in NVDA

Classes [hide private]
  Logger
  RemoteHandler
  FileHandler
  Formatter
  StreamRedirector
Redirects an output stream to a logger.
Functions [hide private]
 
isPathExternalToNVDA(path)
Checks if the given path is external to NVDA (I.e.
source code
string
getCodePath(f)
Using a frame object, gets its module path (relative to the current directory).[className.[funcName]]
source code
 
stripBasePathFromTracebackText(text) source code
 
redirectStdout(logger)
Redirect stdout and stderr to a given logger.
source code
 
_getDefaultLogFilePath() source code
 
_excepthook(*exc_info) source code
 
_showwarning(message, category, filename, lineno, file=None, line=None) source code
 
initialize(shouldDoRemoteLogging=False)
Initialize logging.
source code
 
setLogLevelFromConfig()
Set the log level based on the current configuration.
source code
Variables [hide private]
  ERROR_INVALID_WINDOW_HANDLE = 1400
  ERROR_TIMEOUT = 1460
  RPC_S_SERVER_UNAVAILABLE = 1722
  RPC_S_CALL_FAILED_DNE = 1727
  EPT_S_NOT_REGISTERED = 1753
  E_ACCESSDENIED = -2147024891
  CO_E_OBJNOTCONNECTED = -2147220995
  EVENT_E_ALL_SUBSCRIBERS_FAILED = -2147220991
  RPC_E_CALL_REJECTED = -2147418111
  RPC_E_DISCONNECTED = -2147417848
  LOAD_WITH_ALTERED_SEARCH_PATH = 8
  BASE_PATH = 'C:\\project\\NVDA\\src\\source\\'
  TB_BASE_PATH_PREFIX = ' File "'
  TB_BASE_PATH_MATCH = ' File "C:\\project\\NVDA\\src\\source\\'
Logger log = Logger("nvda")
The singleton logger instance.
  __package__ = None
hash(x)
Function Details [hide private]

isPathExternalToNVDA(path)

source code 

Checks if the given path is external to NVDA (I.e. not pointing to built-in code).

getCodePath(f)

source code 

Using a frame object, gets its module path (relative to the current directory).[className.[funcName]]

Parameters:
  • f (frame) - the frame object to use
Returns: string
the dotted module.class.attribute path

redirectStdout(logger)

source code 

Redirect stdout and stderr to a given logger.

Parameters:
  • logger (Logger) - The logger to which to redirect.

initialize(shouldDoRemoteLogging=False)

source code 

Initialize logging. This must be called before any logging can occur.

Parameters:
  • shouldDoRemoteLogging (bool)

Precondition: The command line arguments have been parsed into globalVars.appArgs.