On 11/18/2010 07:53 AM, Jes Sorensen wrote:
On 11/16/10 17:01, Michael Roth wrote:
+#define DEBUG_VA
+
+#ifdef DEBUG_VA
+#define TRACE(msg, ...) do { \
+ fprintf(stderr, "%s:%s():L%d: " msg "\n", \
+ __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
+} while(0)
+#else
+#define TRACE(msg, ...) \
+ do { } while (0)
+#endif
+
+#define LOG(msg, ...) do { \
+ fprintf(stderr, "%s:%s(): " msg "\n", \
+ __FILE__, __FUNCTION__, ## __VA_ARGS__); \
+} while(0)
I am sure I saw those macros in a couple of other places in the tree
recently :)
Hehe, too much compartmentalization.
I do plan on moving to QEMU tracing statements instead of a macro...
I only just now noticed qemu_log(), I take it this is the preferred route?
+#define TADDR "127.0.0.1:8080"
+#define URL "http://localhost:8080/RPC2"
Rather than relying on hard coded addresses for this, how about moving
it to a config file?
Cheers,
Jes