Thanks very much Minas!<div><br></div><div>Actually, when it comes to debugging, I would love to be able to pass the debug level information at runtime rather than at compile-time. If you can come up with a better framework for debugging than what is currently there, that would be great. In other words, I would rather change the framework rather than improving it :)</div>
<div><br></div><div>Still, I will take a look at your patch.</div><div><br></div><div>Thanks!</div><div>Nicolas<br><br><div class="gmail_quote">On Mon, Jul 19, 2010 at 8:18 PM, Minas Abrahamyan <span dir="ltr"><<a href="mailto:minas.subs@gmail.com">minas.subs@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
Printing of debug messages is very useful for debugging of any kind;<br>
This patch allows to print them again, as it was possible few ages ago :)<br>
Maybe not everything in right include files here, but that is better<br>
than absence of debug logs<br>
<br>
To apply:<br>
$ cd vmkit<br>
$ patch -p1 <../vmkit_debuglog.patch<br>
<br>
To turn on: uncomment vmkit/include/debug.h line 13:<br>
#define DEBUG 10<br>
<br>
To turn off - comment it back:<br>
//#define DEBUG 10<br>
<br>
To manage VMCore subsystem logs generation:<br>
In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47:<br>
#define JNJVM_LOAD 3<br>
#define JNJVM_COMPILE 2<br>
<br>
JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off<br>
JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off<br>
<br>
To add new logging messages, insert something like:<br>
PRINT_DEBUG(symb, level, color, printf-like-argslist)<br>
Fotr example:<br>
PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n");<br>
where<br>
symb - is subsystem debug level,<br>
level - is current message required level;<br>
  Message is printed only if symb>level; subsystem logging level is<br>
bigger than necessary by current message level;<br>
COLOR_NORMAL - is default color.<br>
 ( In fact it supports fancy colour printing on terminal, through<br>
third argument, but I'm not using it.)<br>
<br>
In this example Message will be printed if DEBUG is defined, and JNJVM_LOAD >0.<br>
<br>
PRINT_DEBUG prints to stderr.<br>
<br>
==<br>
Nicolas, please review and apply this patch.<br>
Thanks.<br>
<font color="#888888"><br>
-Minas<br>
</font><br>_______________________________________________<br>
vmkit-commits mailing list<br>
<a href="mailto:vmkit-commits@cs.uiuc.edu">vmkit-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits</a><br>
<br></blockquote></div><br></div>