Module logHandler
[hide private]
[frames] | no frames]

Module logHandler

source code

Utilities and classes to manage logging in NVDA

Classes [hide private]
  Logger
  FileHandler
  Formatter
  StreamRedirector
Redirects an output stream to a logger.
Functions [hide private]
string
makeModulePathFromFilePath(path)
calculates the pythonic dotted module path from a file path of a python module.
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()
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
  E_ACCESSDENIED = -2147024891
  EVENT_E_ALL_SUBSCRIBERS_FAILED = -2147220991
  RPC_E_CALL_REJECTED = -2147418111
  RPC_E_DISCONNECTED = -2147417848
  moduleCache = {}
  BASE_PATH = os.path.split(__file__) [0]+ os.sep
  TB_BASE_PATH_PREFIX = ' File "'
  TB_BASE_PATH_MATCH = TB_BASE_PATH_PREFIX+ BASE_PATH
  log = Logger("nvda")
Function Details [hide private]

makeModulePathFromFilePath(path)

source code 

calculates the pythonic dotted module path from a file path of a python module.

Parameters:
  • path (string) - the relative or absolute path to the module
Returns: string
the Pythonic dotted module path

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

source code 

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

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