XQuartz: ASL: Update logging to support differnet levels and subsystems
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
c0077b41b4
commit
a66400f8db
|
@ -79,7 +79,7 @@
|
||||||
|
|
||||||
aslclient aslc;
|
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;
|
va_list args;
|
||||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
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);
|
asl_set(msg, "Line", _line);
|
||||||
free(_line);
|
free(_line);
|
||||||
}
|
}
|
||||||
|
if(subsystem)
|
||||||
|
asl_set(msg, "Subsystem", subsystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args);
|
asl_vlog(aslc, msg, level, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if(msg)
|
if(msg)
|
||||||
|
|
|
@ -76,9 +76,11 @@ extern int darwinMainScreenY;
|
||||||
// bundle-main.c
|
// bundle-main.c
|
||||||
extern char *bundle_id_prefix;
|
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")
|
#define TRACE() DEBUG_LOG("TRACE")
|
||||||
|
|
||||||
#endif /* _DARWIN_H */
|
#endif /* _DARWIN_H */
|
||||||
|
|
Loading…
Reference in New Issue