From 7ec2d1c53b753238509bf7a89587509305b9216d Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Sun, 19 Oct 2008 20:06:14 +0000 Subject: move to asio socket libary for sync bugs / todos: * new connections don't sync * anyrtpproxy broken * anytun-controlld doesn't send data --- src/Sockets/Debug.h | 75 ----------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/Sockets/Debug.h (limited to 'src/Sockets/Debug.h') diff --git a/src/Sockets/Debug.h b/src/Sockets/Debug.h deleted file mode 100644 index 9bc06b9..0000000 --- a/src/Sockets/Debug.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _SOCKETS_Debug_H -#define _SOCKETS_Debug_H - -#include "sockets-config.h" -#include -#include "Utility.h" -#include - - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - - -class Debug -{ -static const char *colors[]; -public: - class endl { - public: - endl() {} - virtual ~endl() {} - }; - -public: - Debug() {} - Debug(const std::string& x) : m_id(0), m_text(x) { - fprintf(stderr, "%s", colors[Utility::ThreadID() % 16 + 1]); - for (int i = 0; i < m_level[Utility::ThreadID()]; i++) - fprintf(stderr, " "); - fprintf(stderr, "%s%s\n", x.c_str(), colors[0]); - m_level[Utility::ThreadID()]++; - } - Debug(int id, const std::string& x) : m_id(id), m_text(x) { - fprintf(stderr, "%s", colors[Utility::ThreadID() % 16 + 1]); - for (int i = 0; i < m_level[Utility::ThreadID()]; i++) - fprintf(stderr, " "); - fprintf(stderr, "%d> %s%s\n", m_id, x.c_str(), colors[0]); - m_level[Utility::ThreadID()]++; - } - ~Debug() { - if (!m_text.empty()) - { - if (m_level[Utility::ThreadID()]) - m_level[Utility::ThreadID()]--; - fprintf(stderr, "%s", colors[Utility::ThreadID() % 16 + 1]); - for (int i = 0; i < m_level[Utility::ThreadID()]; i++) - fprintf(stderr, " "); - if (m_id) - fprintf(stderr, "%d> /%s%s\n", m_id, m_text.c_str(), colors[0]); - else - fprintf(stderr, "/%s%s\n", m_text.c_str(), colors[0]); - fflush(stderr); - } - } -static void Print(const char *format, ...); - - Debug& operator<<(const std::string& ); - Debug& operator<<(long); - Debug& operator<<(endl); - -private: - int m_id; - std::string m_text; -static std::map m_level; - std::string m_line; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - -#endif // _SOCKETS_Debug_H - -- cgit v1.2.3