replaced fprintf() with msg(), added XBUTTON_DEBUG