Switch to unified view

a/libupnpp/log.hxx b/libupnpp/log.hxx
...
...
27
    public:
27
    public:
28
        static Logger *getTheLog(const std::string& fn);
28
        static Logger *getTheLog(const std::string& fn);
29
        std::ostream& getstream() {
29
        std::ostream& getstream() {
30
            return m_tocerr ? std::cerr : m_stream;
30
            return m_tocerr ? std::cerr : m_stream;
31
        }
31
        }
32
        enum LogLevel {LLNON, LLFAT, LLERR, LLINF, LLDEB};
32
        enum LogLevel {LLNON, LLFAT, LLERR, LLINF, LLDEB, LLDEB1};
33
        void setLogLevel(LogLevel level) {
33
        void setLogLevel(LogLevel level) {
34
            m_loglevel = level;
34
            m_loglevel = level;
35
        }
35
        }
36
        int getloglevel() {
36
        int getloglevel() {
37
            return m_loglevel;
37
            return m_loglevel;
...
...
48
    };
48
    };
49
        
49
        
50
}
50
}
51
51
52
#define DEBOUT (upnppdebug::Logger::getTheLog("")->getstream())
52
#define DEBOUT (upnppdebug::Logger::getTheLog("")->getstream())
53
#define LOCAL_LOGINC 0
53
#define LOGLEVEL (upnppdebug::Logger::getTheLog("")->getloglevel())
54
#define LOGLEVEL (upnppdebug::Logger::getTheLog("")->getloglevel()+LOCAL_LOGINC)
55
56
#define LOGDEB1(X) {                                                    \
57
        if (LOGLEVEL >= upnppdebug::Logger::LLDEB1)                     \
58
        {                                                               \
59
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
60
        }                                                               \
61
    }
54
62
55
#define LOGDEB(X) {                                                     \
63
#define LOGDEB(X) {                                                     \
56
        if (LOGLEVEL >= upnppdebug::Logger::LLDEB) \
64
        if (LOGLEVEL >= upnppdebug::Logger::LLDEB)                      \
57
        {                                                               \
65
        {                                                               \
58
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
66
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
59
        }                                                               \
67
        }                                                               \
60
    }
68
    }
61
69
62
#define LOGINF(X) {                                                     \
70
#define LOGINF(X) {                                                     \
63
        if (LOGLEVEL >= upnppdebug::Logger::LLINF)                  \
71
        if (LOGLEVEL >= upnppdebug::Logger::LLINF)                      \
64
        {                                                               \
72
        {                                                               \
65
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
73
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
66
        }                                                               \
74
        }                                                               \
67
    }                                                                   
75
    }                                                                   
68
76
69
#define LOGERR(X) {                                                     \
77
#define LOGERR(X) {                                                     \
70
        if (LOGLEVEL >= upnppdebug::Logger::LLERR)                  \
78
        if (LOGLEVEL >= upnppdebug::Logger::LLERR)                      \
71
        {                                                               \
79
        {                                                               \
72
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
80
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
73
        }                                                               \
81
        }                                                               \
74
    }
82
    }
75
83
76
#define LOGFAT(X) {                                                     \
84
#define LOGFAT(X) {                                                     \
77
        if (LOGLEVEL >= upnppdebug::Logger::LLFAT)                  \
85
        if (LOGLEVEL >= upnppdebug::Logger::LLFAT)                      \
78
        {                                                               \
86
        {                                                               \
79
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
87
            DEBOUT << __FILE__ << ":" << __LINE__<< "::"; DEBOUT << X;  \
80
        }                                                               \
88
        }                                                               \
81
    }
89
    }
82
90