src/proto2/Logger.hh
author terom
Sat, 08 Nov 2008 21:25:56 +0000
changeset 23 8d802b573cf0
child 24 b81cb670e6b2
permissions -rw-r--r--
fixed more network code, there's actually a high probability of it working now
#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 */