src/proto2/Logger.hh
author saiam
Sat, 29 Nov 2008 16:12:25 +0000
changeset 130 81406f8b7535
parent 24 b81cb670e6b2
permissions -rw-r--r--
New Vector.hh with some more documentation and unary operator for * defined. Also modified operators +=, -=, *= and /= to use
operators +, -, * and /.
#ifndef LOGGER_HH
#define LOGGER_HH

#include <ClanLib/network.h>

#include <iostream>

enum LogLevel {
    FATAL,
    ERROR,
    WARN,
    INFO,
    DEBUG,
};

class Logger {
    private:
        std::ostream &stream;
        enum LogLevel level;
        const char *module;

    public:
        Logger (std::ostream &stream, enum LogLevel level, const char *module);

        template <typename T> Logger& operator<< (T &val) {
            stream << val;

            return *this;
        }


        ~Logger (void);
};

std::ostream& operator<< (std::ostream &s, CL_NetComputer &c);
std::ostream& operator<< (std::ostream &s, CL_NetObject_Server &obj);
std::ostream& operator<< (std::ostream &s, CL_NetObject_Client &obj);

#endif /* LOGGER_HH */