Index: cpp/frams/loggers/loggers.cpp
===================================================================
--- cpp/frams/loggers/loggers.cpp	(revision 375)
+++ cpp/frams/loggers/loggers.cpp	(revision 375)
@@ -0,0 +1,124 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "loggers.h"
+#include <common/stl-util.h>
+
+void _logMessageSingleLine(const char *o, const char *m, int w, const char *txt)
+{
+	tlsGetRef(message_handler_manager_instance).send(o, m, w, txt);
+}
+
+THREAD_LOCAL_DEF(LoggerManager, message_handler_manager_instance);
+
+void LoggerManager::send(int level, const char *o, const char *m, int w, const char *bl)
+{
+	if (level >= handlers.size()) level = handlers.size() - 1;
+	bool blocked = 0;
+	for (int i = level; i >= 0; i--)
+	{
+		LoggerBase *r = handlers(i);
+		if ((!(r->options & LoggerBase::Paused)) &&
+			((!blocked) || (r->options & LoggerBase::CannotBeBlocked)))
+		{
+			r->handle(o, m, w, bl);
+			if (!(r->options & LoggerBase::DontBlock)) blocked = 1;
+		}
+	}
+}
+
+int LoggerManager::add(LoggerBase *h)
+{
+	h->manager = this;
+	handlers += h;
+	return handlers.size() - 1;
+}
+
+void LoggerManager::remove(int i)
+{
+	LoggerBase *h = handlers(i);
+	h->manager = NULL;
+	handlers.remove(i);
+}
+
+void LoggerManager::remove(LoggerBase *h)
+{
+	int i;
+	if ((i = handlers.find(h)) < 0) return;
+	remove(i);
+}
+
+void LoggerManager::removeAll()
+{
+	while (handlers.size() > 0)
+		remove(handlers.size() - 1);
+}
+
+//////////////////////////////////
+
+void LoggerBase::send(const char *o, const char *m, int w, const char *bl)
+{
+	if (!isEnabled()) return;
+	int level = manager->find(this);
+	if (level >= 0) manager->send(level - 1, o, m, w, bl);
+}
+
+void LoggerBase::logPrintf(const char *o, const char *m, int w, const char *bl, ...)
+{
+	if (!isEnabled()) return;
+	string buf;
+	va_list argptr;
+	va_start(argptr, bl);
+	buf = ssprintf_va(bl, argptr);
+	va_end(argptr);
+	send(o, m, w, buf.c_str());
+}
+
+
+void LoggerBase::enable()
+{
+	if (isEnabled()) return;
+	tlsGetRef(message_handler_manager_instance).add(this);
+}
+
+void LoggerBase::disable()
+{
+	if (!isEnabled()) return;
+	tlsGetRef(message_handler_manager_instance).remove(this);
+}
+
+void LoggerBase::pause()
+{
+	if (isPaused()) return;
+	options |= Paused;
+}
+
+void LoggerBase::resume()
+{
+	if (!isPaused()) return;
+	options &= ~Paused;
+}
+
+/////////////////////////////////
+
+void LoggerToMemory::handle(const char *o, const char *m, int w, const char *bl)
+{
+	if (w > maxlevel) maxlevel = w;
+	if (w >= LOG_INFO) infocount++;
+	if (w >= LOG_WARN) warncount++;
+	if (w >= LOG_ERROR) errcount++;
+
+	if (w >= minleveltostore)
+	{
+		storedcount++;
+		if (options & (StoreFirstMessage | StoreAllMessages))
+		{
+			if (!((options&StoreFirstMessage) && (msgs.len() > 0)))
+			{
+				if (msgs.len() > 0) msgs += '\n';
+				msgs += SString::sprintf(LOG_FORMAT,LOG_LEVEL[w+1],o,m,bl);
+			}
+		}
+	}
+}
Index: cpp/frams/loggers/loggers.h
===================================================================
--- cpp/frams/loggers/loggers.h	(revision 375)
+++ cpp/frams/loggers/loggers.h	(revision 375)
@@ -0,0 +1,118 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _FRAMS_LOGGERS_H_
+#define _FRAMS_LOGGERS_H_
+
+#include <frams/util/list.h>
+#include <frams/util/sstring.h>
+#include <common/log.h>
+#include <common/threads.h>
+
+class LoggerBase;
+
+class LoggerManager
+{
+	friend class LoggerBase;
+	SListTempl<LoggerBase*> handlers;
+	void send(int level, const char *o, const char *m, int w, const char *bl);
+public:
+	int find(LoggerBase *r) { return handlers.find(r); }
+	int add(LoggerBase *r);
+	void remove(int i);
+	void remove(LoggerBase *r);
+	void removeAll();
+	void send(const char *o, const char *m, int w, const char *bl)
+	{
+		send(handlers.size() - 1, o, m, w, bl);
+	}
+	~LoggerManager() { removeAll(); }
+};
+
+extern THREAD_LOCAL_DECL(LoggerManager, message_handler_manager_instance);
+
+////////////////////////////////////////
+
+class LoggerBase
+{
+	friend class LoggerManager;
+protected:
+	LoggerManager* manager;
+	int options;
+
+public:
+
+	enum LoggerOptions
+	{
+		DontBlock = 1, CannotBeBlocked = 2, Enable = 4, Paused = 8
+	};
+
+	void logPrintf(const char *o, const char *m, int w, const char *bl, ...);
+	void send(const char *o, const char *m, int w, const char *bl);
+
+	bool isEnabled() { return manager ? true : false; }
+	void enable();
+	void disable();
+	bool isPaused() { return (options & Paused) != 0; }
+	void pause();
+	void resume();
+
+	LoggerBase(int opts = 0) :manager(NULL), options(opts)
+	{
+		if (options&Enable) enable();
+	}
+	virtual ~LoggerBase()
+	{
+		disable();
+	}
+
+	virtual void handle(const char *o, const char *m, int w, const char *bl) {}
+};
+
+///////////////////////////////////////////
+
+class LoggerToMemory : public LoggerBase
+{
+protected:
+	int maxlevel, minleveltostore, errcount, warncount, storedcount, infocount;
+	SString msgs;
+
+public:
+
+	void reset() { maxlevel = LOG_INFO - 1; errcount = warncount = storedcount = infocount = 0; msgs = 0; }
+
+	enum Options2
+	{
+		StoreFirstMessage = 16, StoreAllMessages = 32
+	};
+
+	int getErrorCount()       { return errcount; }
+	int getWarningCount()     { return warncount; }
+	int getInfoCount()        { return infocount; }
+	int getStoredCount()      { return storedcount; }
+	int getErrorLevel()       { return maxlevel; }
+	const SString& getMessages() { return msgs; }
+
+	LoggerToMemory(int opts = 0, int minimal_level_to_store = LOG_ERROR) :LoggerBase(opts), minleveltostore(minimal_level_to_store)
+	{
+		reset();
+	}
+
+	void handle(const char *o, const char *m, int w, const char *bl);
+};
+
+class RedirectingLogger : public LoggerBase
+{
+	LoggerManager *other_manager;
+public:
+	RedirectingLogger(LoggerManager *other_mgr,int opts=0)
+		:LoggerBase(opts), other_manager(other_mgr) {}
+
+	void handle(const char *o, const char *m, int w, const char *bl)
+	{
+		other_manager->send(o, m, w, bl);
+	}
+};
+
+#endif
Index: cpp/frams/loggers/loggertostdout.cpp
===================================================================
--- cpp/frams/loggers/loggertostdout.cpp	(revision 375)
+++ cpp/frams/loggers/loggertostdout.cpp	(revision 375)
@@ -0,0 +1,23 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "loggertostdout.h"
+#ifdef SHP
+#include <FBaseSys.h> //AppLog
+#else
+#include <stdio.h>
+#endif
+
+void LoggerToStdout::handle(const char *o, const char *m, int w, const char *bl)
+{
+	if (w < -1) w = -1; else if (w>3) w = 3;
+#ifdef SHP
+	AppLog(LOG_FORMAT "\n",LOG_LEVEL[w+1],o,m,bl);
+#else
+	if (file)
+		file->printf(LOG_FORMAT "\n", LOG_LEVEL[w + 1], o, m, bl);
+	else
+		printf(LOG_FORMAT "\n", LOG_LEVEL[w + 1], o, m, bl);
+#endif
+}
Index: cpp/frams/loggers/loggertostdout.h
===================================================================
--- cpp/frams/loggers/loggertostdout.h	(revision 375)
+++ cpp/frams/loggers/loggertostdout.h	(revision 375)
@@ -0,0 +1,19 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _STDOUT_LOGGER_H_
+#define _STDOUT_LOGGER_H_
+
+#include "loggers.h"
+#include <frams/virtfile/virtfile.h>
+
+class LoggerToStdout : public LoggerBase
+{
+	VirtFILE *file;
+public:
+	LoggerToStdout(int opts = 0, VirtFILE *_file = NULL) :LoggerBase(opts), file(_file) {}
+	void handle(const char *o, const char *m, int w, const char *bl);
+};
+
+#endif
Index: cpp/frams/loggers/mhandlers.cpp
===================================================================
--- cpp/frams/mhandlers/mhandlers.cpp	(revision 373)
+++ 	(revision )
@@ -1,125 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#include "mhandlers.h"
-#include <common/stl-util.h>
-
-void _HmessageSingleLine(const char *o, const char *m, const char *txt, int w)
-{
-	tlsGetRef(message_handler_manager_instance).send(o, m, txt, w);
-}
-
-THREAD_LOCAL_DEF(MessageHandlerManager, message_handler_manager_instance);
-
-void MessageHandlerManager::send(int level, const char *o, const char *m, const char *bl, int w)
-{
-	if (level >= handlers.size()) level = handlers.size() - 1;
-	bool blocked = 0;
-	for (int i = level; i >= 0; i--)
-	{
-		MessageHandlerBase *r = handlers(i);
-		if ((!(r->options & MessageHandlerBase::Paused)) &&
-			((!blocked) || (r->options & MessageHandlerBase::CannotBeBlocked)))
-		{
-			r->handle(o, m, bl, w);
-			if (!(r->options & MessageHandlerBase::DontBlock)) blocked = 1;
-		}
-	}
-}
-
-int MessageHandlerManager::add(MessageHandlerBase *h)
-{
-	h->manager = this;
-	handlers += h;
-	return handlers.size() - 1;
-}
-
-void MessageHandlerManager::remove(int i)
-{
-	MessageHandlerBase *h = handlers(i);
-	h->manager = NULL;
-	handlers.remove(i);
-}
-
-void MessageHandlerManager::remove(MessageHandlerBase *h)
-{
-	int i;
-	if ((i = handlers.find(h)) < 0) return;
-	remove(i);
-}
-
-void MessageHandlerManager::removeAll()
-{
-	while (handlers.size() > 0)
-		remove(handlers.size() - 1);
-}
-
-//////////////////////////////////
-
-void MessageHandlerBase::send(const char *o, const char *m, const char *bl, int w)
-{
-	if (!isEnabled()) return;
-	int level = manager->find(this);
-	if (level >= 0) manager->send(level - 1, o, m, bl, w);
-}
-
-void MessageHandlerBase::Hprintf(const char *o, const char *m, int w, const char *bl, ...)
-{
-	if (!isEnabled()) return;
-	string buf;
-	va_list argptr;
-	va_start(argptr, bl);
-	buf = ssprintf_va(bl, argptr);
-	va_end(argptr);
-	send(o, m, buf.c_str(), w);
-}
-
-
-void MessageHandlerBase::enable()
-{
-	if (isEnabled()) return;
-	tlsGetRef(message_handler_manager_instance).add(this);
-}
-
-void MessageHandlerBase::disable()
-{
-	if (!isEnabled()) return;
-	tlsGetRef(message_handler_manager_instance).remove(this);
-}
-
-void MessageHandlerBase::pause()
-{
-	if (isPaused()) return;
-	options |= Paused;
-}
-
-void MessageHandlerBase::resume()
-{
-	if (!isPaused()) return;
-	options &= ~Paused;
-}
-
-/////////////////////////////////
-
-void MessageHandlerToMemory::handle(const char *o, const char *m, const char *bl, int w)
-{
-	if (w > maxlevel) maxlevel = w;
-	if (w >= HMLV_INFO) infocount++;
-	if (w >= HMLV_WARN) warncount++;
-	if (w >= HMLV_ERROR) errcount++;
-
-	if (w >= minleveltostore)
-	{
-		storedcount++;
-		if (options & (StoreFirstMessage | StoreAllMessages))
-		{
-			if (!((options&StoreFirstMessage) && (msgs.len() > 0)))
-			{
-				if (msgs.len() > 0) msgs += '\n';
-				msgs += o; msgs += "::"; msgs += m;
-				msgs += " - "; msgs += bl;
-			}
-		}
-	}
-}
Index: cpp/frams/loggers/mhandlers.h
===================================================================
--- cpp/frams/mhandlers/mhandlers.h	(revision 373)
+++ 	(revision )
@@ -1,118 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#ifndef _MHANDLERS_H_
-#define _MHANDLERS_H_
-
-#include <frams/util/list.h>
-#include <frams/util/sstring.h>
-#include <common/hmessage.h>
-#include <common/threads.h>
-
-class MessageHandlerBase;
-
-class MessageHandlerManager
-{
-	friend class MessageHandlerBase;
-	SListTempl<MessageHandlerBase*> handlers;
-	void send(int level, const char *o, const char *m, const char *bl, int w);
-public:
-	int find(MessageHandlerBase *r) { return handlers.find(r); }
-	int add(MessageHandlerBase *r);
-	void remove(int i);
-	void remove(MessageHandlerBase *r);
-	void removeAll();
-	void send(const char *o, const char *m, const char *bl, int w)
-	{
-		send(handlers.size() - 1, o, m, bl, w);
-	}
-	~MessageHandlerManager() { removeAll(); }
-};
-
-extern THREAD_LOCAL_DECL(MessageHandlerManager, message_handler_manager_instance);
-
-////////////////////////////////////////
-
-class MessageHandlerBase
-{
-	friend class MessageHandlerManager;
-protected:
-	MessageHandlerManager* manager;
-	int options;
-
-public:
-
-	enum HandlerOptions
-	{
-		DontBlock = 1, CannotBeBlocked = 2, Enable = 4, Paused = 8
-	};
-
-	void Hprintf(const char *o, const char *m, int w, const char *bl, ...);
-	void send(const char *o, const char *m, const char *bl, int w);
-
-	bool isEnabled() { return manager ? true : false; }
-	void enable();
-	void disable();
-	bool isPaused() { return (options & Paused) != 0; }
-	void pause();
-	void resume();
-
-	MessageHandlerBase(int opts = 0) :manager(NULL), options(opts)
-	{
-		if (options&Enable) enable();
-	}
-	virtual ~MessageHandlerBase()
-	{
-		disable();
-	}
-
-	virtual void handle(const char *o, const char *m, const char *bl, int w) {}
-};
-
-///////////////////////////////////////////
-
-class MessageHandlerToMemory : public MessageHandlerBase
-{
-protected:
-	int maxlevel, minleveltostore, errcount, warncount, storedcount, infocount;
-	SString msgs;
-
-public:
-
-	void reset() { maxlevel = HMLV_INFO - 1; errcount = warncount = storedcount = infocount = 0; msgs = 0; }
-
-	enum Options2
-	{
-		StoreFirstMessage = 16, StoreAllMessages = 32
-	};
-
-	int getErrorCount()       { return errcount; }
-	int getWarningCount()     { return warncount; }
-	int getInfoCount()        { return infocount; }
-	int getStoredCount()      { return storedcount; }
-	int getErrorLevel()       { return maxlevel; }
-	const SString& getMessages() { return msgs; }
-
-	MessageHandlerToMemory(int opts = 0, int minimal_level_to_store = HMLV_ERROR) :MessageHandlerBase(opts), minleveltostore(minimal_level_to_store)
-	{
-		reset();
-	}
-
-	void handle(const char *o, const char *m, const char *bl, int w);
-};
-
-class RedirectingMessageHandler : public MessageHandlerBase
-{
-	MessageHandlerManager *other_manager;
-public:
-	RedirectingMessageHandler(MessageHandlerManager *other_mgr,int opts=0)
-		:MessageHandlerBase(opts), other_manager(other_mgr) {}
-
-	void handle(const char *o, const char *m, const char *bl, int w)
-	{
-		other_manager->send(o, m, bl, w);
-	}
-};
-
-#endif
Index: cpp/frams/loggers/stderrors.cpp
===================================================================
--- cpp/frams/mhandlers/stderrors.cpp	(revision 373)
+++ 	(revision )
@@ -1,34 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#include "stderrors.h"
-#include <frams/util/sstringutils.h>
-#include <common/hmessage.h>
-
-bool listIndexCheck(SList* list,int index,const char* msgobj,const char* msgfun)
-{
-	int size=list->size();
-if ((index<0)||(index>=size))
-	{
-	if (size>0) 
-		Hprintf(msgobj,msgfun,HMLV_ERROR,"Invalid index %d (allowed range is 0..%d)",index,size-1);
-	else
-		Hprintf(msgobj,msgfun,HMLV_ERROR,"Invalid index %d (this list is empty)",index);
-	return 0;
-	}
-return 1;
-}
-
-SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(SString& in))
-{
-if (!checker)
-	checker=trim;
-SString corrected=checker(in);
-if (corrected!=in)
-	{
-	SString msg2=SString(msg)+": \"%s\" (adjusted to \"%s\")";
-	Hprintf(msgobj,msgfun,HMLV_WARN,msg2.c_str(),in.c_str(),corrected.c_str());
-	}
-return corrected;
-}
Index: cpp/frams/loggers/stderrors.h
===================================================================
--- cpp/frams/mhandlers/stderrors.h	(revision 373)
+++ 	(revision )
@@ -1,14 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#ifndef _STDERRORS_H_
-#define _STDERRORS_H_
-
-#include <frams/util/list.h>
-#include <frams/util/sstring.h>
-
-bool listIndexCheck(SList* list,int index,const char* msgobj,const char* msgfun);
-SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(SString& in)=0);
-
-#endif
Index: cpp/frams/loggers/stdouthandler.cpp
===================================================================
--- cpp/frams/mhandlers/stdouthandler.cpp	(revision 373)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#include "stdouthandler.h"
-#ifdef SHP
-#include <FBaseSys.h> //AppLog
-#else
-#include <stdio.h>
-#endif
-
-void MessageHandlerToStdout::handle(const char *o, const char *m, const char *bl, int w)
-{
-	if (w < -1) w = -1; else if (w>3) w = 3;
-#ifdef SHP
-	AppLog(HMSG_FORMAT "\n",HMSG_LEVEL[w+1],o,m,bl);
-#else
-	if (file)
-		file->printf(HMSG_FORMAT "\n", HMSG_LEVEL[w + 1], o, m, bl);
-	else
-		printf(HMSG_FORMAT "\n", HMSG_LEVEL[w + 1], o, m, bl);
-#endif
-}
Index: cpp/frams/loggers/stdouthandler.h
===================================================================
--- cpp/frams/mhandlers/stdouthandler.h	(revision 373)
+++ 	(revision )
@@ -1,19 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#ifndef _STDOUTHANDLER_H_
-#define _STDOUTHANDLER_H_
-
-#include "mhandlers.h"
-#include <frams/virtfile/virtfile.h>
-
-class MessageHandlerToStdout : public MessageHandlerBase
-{
-	VirtFILE *file;
-public:
-	MessageHandlerToStdout(int opts = 0, VirtFILE *_file = NULL) :MessageHandlerBase(opts), file(_file) {}
-	void handle(const char *o, const char *m, const char *bl, int w);
-};
-
-#endif
