diff options
author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-05-28 15:29:19 +0000 |
---|---|---|
committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-05-28 15:29:19 +0000 |
commit | 616adfc77dc1d08f3bfcd79991a78c6350e4e2f6 (patch) | |
tree | a47349dfb9e7729736c7b5892681a7c1c61dff89 /mg_tools.h | |
parent | 1a95137eb0f4d533bc38377558de8ccc442e5de6 (diff) | |
download | vdr-plugin-muggle-616adfc77dc1d08f3bfcd79991a78c6350e4e2f6.tar.gz vdr-plugin-muggle-616adfc77dc1d08f3bfcd79991a78c6350e4e2f6.tar.bz2 |
Merged player branch back on HEAD branch.
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@98 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'mg_tools.h')
-rw-r--r-- | mg_tools.h | 61 |
1 files changed, 57 insertions, 4 deletions
@@ -3,10 +3,10 @@ * \brief A few util functions for standalone and plugin messaging * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.2 $ - * \date $Date: 2004/02/02 22:48:04 $ + * \version $Revision: 1.3 $ + * \date $Date: 2004/05/28 15:29:18 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author file owner: $Author: MountainMan $ + * \author file owner: $Author: lvw $ * */ /*******************************************************************/ @@ -14,6 +14,9 @@ #ifndef _MUGGLE_TOOLS_H #define _MUGGLE_TOOLS_H +#include <iostream> +#include <string> + #include "mysql/mysql.h" #define STANDALONE 1 @@ -24,12 +27,62 @@ void mgDebug( const char *fmt, ... ); void mgWarning(const char *fmt, ...); void mgError(const char *fmt, ...); - MYSQL_RES* mgSqlReadQuery(MYSQL *db, const char *fmt, ...); void mgSqlWriteQuery(MYSQL *db, const char *fmt, ...); +#ifdef DEBUG +#define MGLOG(x) mgLog __thelog(x) +#else +#define MGLOG(x) {} +#endif + +#ifdef DEBUG +#define MGLOGSTREAM __thelog.getStream() +#else +#define MGLOGSTREAM __thelog.getStream() +#endif + + +class mgLog +{ + public: + enum + { + LOG, WARNING, ERROR, FATAL + } mgLogLevel; + + std::ostream& getStream() + { + return std::cout; + } + + mgLog( std::string methodname ) : m_methodname( methodname ) + { + getStream() << m_methodname << " entered" << std::endl; + }; + + ~mgLog() + { + getStream() << m_methodname << " terminated" << std::endl; + } + + private: + + std::string m_methodname; + +}; + /* -------------------- begin CVS log --------------------------------- * $Log: mg_tools.h,v $ + * Revision 1.3 2004/05/28 15:29:18 lvw + * Merged player branch back on HEAD branch. + * + * Revision 1.2.2.2 2004/04/18 14:08:41 lvw + * Added some more logging/debugging code + * + * Revision 1.2.2.1 2004/04/09 16:14:48 lvw + * Added further code for logging/debugging. + * * Revision 1.2 2004/02/02 22:48:04 MountainMan * added CVS $Log * |