function to write python obects to OutputDebugString on windows
Project description
pydbugstring
Provides a function OutputDebugString to call:
- on win32 platforms, calls the ctypes.windll.kernel32.OutputDebugStringW with any Python Object, after converting that object to a string.
- on other platforms, converts the argument to a string and discards it, returns 0
Provides a handler for the Python Logging Module which sends logging to OutputDebugString. On platforms other than win32, the logging output is disccarded.
The output can be viewed using the DebugView program from the SysInternals package from Microsoft.
Sample Use
import pydebugstring
import sys
import logging
#send an object to OutputDebugString
logger=logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(pydebugstring.OutputDebugStringHandler())
print(f"Sending sys.path [{sys.path}] to outputDebugString")
pydebugstring.outputDebugString(sys.path)
debug_message = "Sample Debug Message"
print(f"Sending [{debug_message}] with logging.info")
logging.info(debug_message)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pydebugstring-1.0.0.2.tar.gz
.
File metadata
- Download URL: pydebugstring-1.0.0.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd5527d718cd791c3dad94442faaa8adad5c2242ea5a822ae28e909e3294d063 |
|
MD5 | f51ec8e7028f127bbf586d003f334730 |
|
BLAKE2b-256 | 54b8c59d1de9fc12a11115f63ecbf20ffc0cea4cd62762433b6067bf38d5f8dc |
File details
Details for the file pydebugstring-1.0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pydebugstring-1.0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd50a5e439978ec89230baa26b22c754fecfd27749b9f665fcd9c26ac135834 |
|
MD5 | f542a2e08e2971a6b79b494b543feac7 |
|
BLAKE2b-256 | fc36961ba97fb6d3e6a7d01653136306bc3981b483e64c64edb046a7cf2e7fa5 |