Skip to content

Instantly share code, notes, and snippets.

@wh13371
wh13371 / output.debug.string.py
Last active October 3, 2024 07:52
python - logging to DbgView with OutputDebugString
#! /usr/bin/python
import logging
import ctypes
# output "logging" messages to DbgView via OutputDebugString (Windows only!)
OutputDebugString = ctypes.windll.kernel32.OutputDebugStringW
class DbgViewHandler(logging.Handler):
def emit(self, record):