diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-06-01 20:45:58 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-06-01 21:07:56 -0700 |
commit | a66400f8dba9b7c5b65f9d26996fff677c42d866 (patch) | |
tree | 048b41e407952e45140938bb7c9ca2b111111d51 | |
parent | c0077b41b4c8bb08129db97a2a01d0af55d13fa4 (diff) |
XQuartz: ASL: Update logging to support differnet levels and subsystems
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | hw/xquartz/darwin.c | 6 | ||||
-rw-r--r-- | hw/xquartz/darwin.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index fa8d4ced2..29ab83677 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -79,7 +79,7 @@ aslclient aslc; -void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) { +void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) { va_list args; aslmsg msg = asl_new(ASL_TYPE_MSG); @@ -93,10 +93,12 @@ void debug_asl (const char *file, const char *function, int line, const char *fm asl_set(msg, "Line", _line); free(_line); } + if(subsystem) + asl_set(msg, "Subsystem", subsystem); } va_start(args, fmt); - asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args); + asl_vlog(aslc, msg, level, fmt, args); va_end(args); if(msg) diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h index 659de432c..aafc12fbf 100644 --- a/hw/xquartz/darwin.h +++ b/hw/xquartz/darwin.h @@ -76,9 +76,11 @@ extern int darwinMainScreenY; // bundle-main.c extern char *bundle_id_prefix; -extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5); +_X_ATTRIBUTE_PRINTF(6,7) +extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...); -#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args); +#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args) +#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "XQuartz", msg, ##args) #define TRACE() DEBUG_LOG("TRACE") #endif /* _DARWIN_H */ |