Index: cpp/common/hmessage.cpp
===================================================================
--- cpp/common/hmessage.cpp	(revision 374)
+++ 	(revision )
@@ -1,61 +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 "hmessage.h"
-#include <common/nonstd_stdio.h>
-#include "stl-util.h"
-#include "Convert.h"
-
-const char* HMSG_LEVEL[]={"[DEBUG] ","","[WARN] ","[ERROR] ","[CRITICAL] "};
-
-void Hmessage(const char *o, const char *m, const char *txt, int w)
-{
-	int line = 0; //all lines except the first one get the "..." prefix
-	const char* nextsep;
-	do
-	{
-		nextsep = strchr(txt, '\n');
-		if (nextsep == NULL) //last chunk, until the end
-			nextsep = strchr(txt, '\0');
-		if ((nextsep > txt) && (nextsep[-1] == '\r'))
-			nextsep--;
-		if (line == 0)
-		{
-			if (*nextsep == 0) //there was only one line! no need to modify it in any way.
-				_HmessageSingleLine(o, m, txt, w);
-			else //first line from multi-line
-				_HmessageSingleLine(o, m, string(txt, nextsep - txt).c_str(), w);
-		}
-		else //consecutive lines from multi-line
-			_HmessageSingleLine(o, m, (HMSG_MULTILINE_CONTINUATION + string(txt, nextsep - txt)).c_str(), w); //could also add line numbers like ...(3)... but let's keep the prefix short and simple
-		line++;
-		if ((nextsep[0] == '\r') && (nextsep[1] == '\n'))
-			txt = nextsep + 2;
-		else if (*nextsep)
-			txt = nextsep + 1;
-	} while (*nextsep);
-}
-
-
-void Hprintf_va(const char *o,const char *m,int w,const char *bl,va_list va)
-{
-	string buf=ssprintf_va(bl,va);
-	Hmessage(o,m,buf.c_str(),w);
-}
-
-void Hprintf(const char *o,const char *m,int w,const char *bl, ...)
-{
-	va_list argptr;
-	va_start(argptr,bl);
-	Hprintf_va(o,m,w,bl,argptr);
-	va_end(argptr);
-}
-
-void printH(const char *bl,...)
-{
-	va_list argptr;
-	va_start(argptr,bl);
-	Hprintf_va("Message","printf",HMLV_INFO,bl,argptr);
-	va_end(argptr);
-}
Index: cpp/common/hmessage.h
===================================================================
--- cpp/common/hmessage.h	(revision 374)
+++ 	(revision )
@@ -1,36 +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 _HMESSAGE_H_
-#define _HMESSAGE_H_
-
-#include <stdarg.h>
-
-extern const char* HMSG_LEVEL[];
-#define HMSG_FORMAT "%s%s.%s: %s"
-#define HMSG_MULTILINE_CONTINUATION "..."
-
-void Hprintf(const char *o,const char *m,int w,const char *bl, ...);
-void Hprintf_va(const char *o,const char *m,int w,const char *bl,va_list va); //a different name than Hprintf - otherwise the compiler could confuse the "string" parameter with va_list and could call the wrong function
-void printH(const char *bl,...); //a shorthand for printf (a different name again to avoid the risk of confusion with the two functions above. This would be unlikely but possible when the argument types would match)
-void Hmessage(const char *o,const char *m,const char *txt,int w);
-
-void _HmessageSingleLine(const char *o,const char *m,const char *txt,int w); //don't call this directly - it is used internally
-
-#define HMLV_DEBUG -1
-#define HMLV_INFO 0
-#define HMLV_WARN 1
-#define HMLV_ERROR 2
-#define HMLV_CRITICAL 3
-
-/*
-w: weight (importance) of a message
--1:debugging information, not needed for final users
-0: information
-1: warning or corrected error
-2: uncorrected error. can cause malfunction
-3: serious error, causes side effects. user should save what can be saved and restart the application
-*/
-
-#endif
Index: cpp/common/log.cpp
===================================================================
--- cpp/common/log.cpp	(revision 375)
+++ cpp/common/log.cpp	(revision 375)
@@ -0,0 +1,61 @@
+// 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 "log.h"
+#include <common/nonstd_stdio.h>
+#include "stl-util.h"
+#include "Convert.h"
+
+const char* LOG_LEVEL[] = { "[DEBUG] ", "", "[WARN] ", "[ERROR] ", "[CRITICAL] " };
+
+void logMessage(const char *obj, const char *method, int level, const char *msg)
+{
+	int line = 0; //all lines except the first one get the "..." prefix
+	const char* nextsep;
+	do
+	{
+		nextsep = strchr(msg, '\n');
+		if (nextsep == NULL) //last chunk, until the end
+			nextsep = strchr(msg, '\0');
+		if ((nextsep > msg) && (nextsep[-1] == '\r'))
+			nextsep--;
+		if (line == 0)
+		{
+			if (*nextsep == 0) //there was only one line! no need to modify it in any way.
+				_logMessageSingleLine(obj, method, level, msg);
+			else //first line from multi-line
+				_logMessageSingleLine(obj, method, level, string(msg, nextsep - msg).c_str());
+		}
+		else //consecutive lines from multi-line
+			_logMessageSingleLine(obj, method, level, (LOG_MULTILINE_CONTINUATION + string(msg, nextsep - msg)).c_str()); //could also add line numbers like ...(3)... but let's keep the prefix short and simple
+		line++;
+		if ((nextsep[0] == '\r') && (nextsep[1] == '\n'))
+			msg = nextsep + 2;
+		else if (*nextsep)
+			msg = nextsep + 1;
+	} while (*nextsep);
+}
+
+
+void logPrintf_va(const char *obj, const char *method, int level, const char *msgf, va_list va)
+{
+	string buf = ssprintf_va(msgf, va);
+	logMessage(obj, method, level, buf.c_str());
+}
+
+void logPrintf(const char *obj, const char *method, int level, const char *msgf, ...)
+{
+	va_list argptr;
+	va_start(argptr, msgf);
+	logPrintf_va(obj, method, level, msgf, argptr);
+	va_end(argptr);
+}
+
+void log_printf(const char *msgf, ...)
+{
+	va_list argptr;
+	va_start(argptr, msgf);
+	logPrintf_va("Message", "printf", LOG_INFO, msgf, argptr);
+	va_end(argptr);
+}
Index: cpp/common/log.h
===================================================================
--- cpp/common/log.h	(revision 375)
+++ cpp/common/log.h	(revision 375)
@@ -0,0 +1,31 @@
+// 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 _COMMON_LOG_H_
+#define _COMMON_LOG_H_
+
+#include <stdarg.h>
+
+extern const char* LOG_LEVEL[];
+#define LOG_FORMAT "%s%s.%s: %s"
+#define LOG_MULTILINE_CONTINUATION "..."
+
+
+void logPrintf(const char *obj, const char *method, int level, const char *msgf, ...);
+void logPrintf_va(const char *obj, const char *method, int level, const char *msgf, va_list va); //a different name than logPrintf - otherwise the compiler could confuse the "string" parameter with va_list and could call the wrong function
+void log_printf(const char *msgf, ...); //a shorthand for printf (a different name again to avoid the risk of confusion with the two functions above. This would be unlikely but possible when the argument types would match)
+void logMessage(const char *obj, const char *method, int level, const char *msg);
+
+void _logMessageSingleLine(const char *obj, const char *method, int level, const char *msg); //don't call this directly - it is used internally
+
+
+
+//level (importance) of a message
+#define LOG_DEBUG -1 //debugging information, not needed for final users
+#define LOG_INFO 0 //information
+#define LOG_WARN 1 //warning or corrected error
+#define LOG_ERROR 2 //uncorrected error, can cause malfunction
+#define LOG_CRITICAL 3 //serious error, causes side effects. User should save what can be saved and restart the application
+
+#endif
Index: cpp/common/nonstd_math.cpp
===================================================================
--- cpp/common/nonstd_math.cpp	(revision 374)
+++ cpp/common/nonstd_math.cpp	(revision 375)
@@ -81,5 +81,5 @@
 // But it was resolved by restarting windows and cleaning all intermediate compilation files :o (restarting windows was the key element! restarting BC++Builder and deleting files would not help)
 
-#include "hmessage.h"
+#include "log.h"
 
 unsigned int fp_control_word_std;
@@ -89,5 +89,5 @@
 {
 	//unsigned int was=_clear87();
-	//Hprintf("","fpExceptInit",HMLV_INFO,"control87 status before clear was %08x", was);
+	//logPrintf("","fpExceptInit",LOG_INFO,"control87 status before clear was %08x", was);
 	fp_control_word_std=_control87(0, 0);             //4978 = 1001101110010
 	// Make the new fp env same as the old one, except for the changes we're going to make
@@ -98,7 +98,7 @@
 {
 	unsigned int was=_clear87(); //trzeba czyscic zeby nie bylo exception...
-	//Hprintf("","fpExceptEnable ",HMLV_INFO,"control87 status before clear was %08x", was);
+	//logPrintf("","fpExceptEnable ",LOG_INFO,"control87 status before clear was %08x", was);
 	_control87(fp_control_word_std, 0xffffffff);
-	//Hprintf("","fpExceptEnable ",HMLV_INFO,"control87 flags are %08x", _control87(0, 0)); //kontrola co sie ustawilo
+	//logPrintf("","fpExceptEnable ",LOG_INFO,"control87 flags are %08x", _control87(0, 0)); //kontrola co sie ustawilo
 }
 
@@ -106,7 +106,7 @@
 {
 	unsigned int was=_clear87(); //trzeba czyscic zeby nie bylo exception...
-	//Hprintf("","fpExceptDisable",HMLV_INFO,"control87 status before clear was %08x", was);
+	//logPrintf("","fpExceptDisable",LOG_INFO,"control87 status before clear was %08x", was);
 	_control87(fp_control_word_muted, 0xffffffff);
-	//Hprintf("","fpExceptDisable",HMLV_INFO,"control87 flags are %08x", _control87(0, 0)); //kontrola co sie ustawilo
+	//logPrintf("","fpExceptDisable",LOG_INFO,"control87 flags are %08x", _control87(0, 0)); //kontrola co sie ustawilo
 }
 
Index: cpp/common/nonstd_stdio.cpp
===================================================================
--- cpp/common/nonstd_stdio.cpp	(revision 374)
+++ cpp/common/nonstd_stdio.cpp	(revision 375)
@@ -242,5 +242,5 @@
 
 #ifdef __ANDROID__
-#include "hmessage.h"
+#include "log.h"
 #include "nonstd.h"
 #include "nonstd_stl.h"
@@ -248,6 +248,6 @@
 {
 	string respath=getAppResourcesDir();
-	//printH("Opening '%s', mode='%s'",path,mode);
-	//printH("getAppResourcesDir()='%s'",respath.c_str());
+	//log_printf("Opening '%s', mode='%s'",path,mode);
+	//log_printf("getAppResourcesDir()='%s'",respath.c_str());
 	NvFile *rfile=NULL; //can only read
 	FILE *rwfile=NULL;
@@ -256,12 +256,12 @@
 		path+=respath.length(); //strip the prefix, we need a relative path in assets
 		if (strstr(mode,"w"))
-			printH("Warning: attempt to open a read-only resource '%s' in writable mode '%s'",path,mode);
+			log_printf("Warning: attempt to open a read-only resource '%s' in writable mode '%s'",path,mode);
 		rfile=NvFOpen(path); //"mode" not supported! can only read
-		//printH("Opened RES file as %p",rfile);
+		//log_printf("Opened RES file as %p",rfile);
 		if (rfile==NULL) return NULL;
 	} else //a "normal" access (HOME)
 	{
 		rwfile=fopen(path,mode);
-		//printH("Opened HOME file as %p",rwfile);
+		//log_printf("Opened HOME file as %p",rwfile);
 		if (rwfile==NULL) return NULL;
 	}
Index: cpp/common/stl-util.cpp
===================================================================
--- cpp/common/stl-util.cpp	(revision 374)
+++ cpp/common/stl-util.cpp	(revision 375)
@@ -9,5 +9,5 @@
 #include "Convert.h"
 #include "nonstd.h"
-#include "hmessage.h"
+#include "log.h"
 #include <assert.h>
 #ifdef USE_VIRTFILE
@@ -103,5 +103,5 @@
 	}
 	if (warn_on_missing_file && !ok)
-		Hprintf("stl-util", "readCompleteFile", HMLV_WARN, "Couldn't open file '%s'", filename);
+		logPrintf("stl-util", "readCompleteFile", LOG_WARN, "Couldn't open file '%s'", filename);
 	return ok;
 }
@@ -129,5 +129,5 @@
 	}
 	if (warn_on_fail && !ok)
-		Hprintf("stl-util", "writeCompleteFile", HMLV_WARN, "couldn't write file '%s'", filename);
+		logPrintf("stl-util", "writeCompleteFile", LOG_WARN, "couldn't write file '%s'", filename);
 	return ok;
 }
