1 /////////////////////////////////////////////////////////////////////////////// 2 // 3 // wxFormBuilder - A Visual Dialog Editor for wxWidgets. 4 // Copyright (C) 2005 José Antonio Hurtado 5 // 6 // This program is free software; you can redistribute it and/or 7 // modify it under the terms of the GNU General Public License 8 // as published by the Free Software Foundation; either version 2 9 // of the License, or (at your option) any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software 18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 // 20 // Written by 21 // José Antonio Hurtado - joseantonio.hurtado@gmail.com 22 // Juan Antonio Ortega - jortegalalmolda@gmail.com 23 // 24 /////////////////////////////////////////////////////////////////////////////// 25 26 #ifndef __DEBUG_H__ 27 #define __DEBUG_H__ 28 29 #include <wx/string.h> 30 #include <wx/log.h> 31 #ifdef __WXFB_DEBUG__ 32 33 #define LogDebug(...) \ 34 { \ 35 wxString LOG_MSG; \ 36 LOG_MSG << wxT(__FILE__); \ 37 LOG_MSG = LOG_MSG.AfterLast('/'); \ 38 LOG_MSG << wxT("@"); \ 39 LOG_MSG << __LINE__; \ 40 LOG_MSG << wxT(" "); \ 41 LOG_MSG << __FUNCTION__; \ 42 LOG_MSG << wxT(": "); \ 43 wxString s; \ 44 s.Printf(__VA_ARGS__); \ 45 LOG_MSG << s; \ 46 wxLogDebug(LOG_MSG); \ 47 } 48 49 #else 50 51 #define LogDebug(...) 52 53 #endif 54 55 #endif //__DEBUG_H__ 56