summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-04-24 22:01:48 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-04-25 18:57:04 -0700
commit0a60192a85ba9f64b522da181c2fe8a5b93b79df (patch)
tree385f42f9be4c680efb0b2e6c36a4a19c465320c7
parentde4023f194c561b74f8fa904bea3dd5298230cd1 (diff)
XQuartz: Enable logging to a file for better debugging
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--hw/xquartz/darwin.c7
-rw-r--r--hw/xquartz/darwin.h3
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c2
3 files changed, 11 insertions, 1 deletions
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 0d2f9e2de..2e18a7427 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -589,6 +589,13 @@ void OsVendorFatalError( void )
void OsVendorInit(void)
{
if (serverGeneration == 1) {
+ char *lf;
+ char *home = getenv("HOME");
+ assert(home);
+ assert(0 < asprintf(&lf, "%s/Library/Logs/X11.%s.log", home, bundle_id_prefix));
+ LogInit(lf, ".old");
+ free(lf);
+
DarwinPrintBanner();
#ifdef ENABLE_DEBUG_LOG
{
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index 3ba5d82c8..507c6f7f6 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -73,6 +73,9 @@ extern int darwinDesiredDepth;
extern int darwinMainScreenX;
extern int darwinMainScreenY;
+// bundle-main.c
+extern char *bundle_id_prefix;
+
#define ENABLE_DEBUG_LOG 1
#ifdef ENABLE_DEBUG_LOG
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 29890215a..bde259e70 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -88,7 +88,7 @@ asm (".desc ___crashreporter_info__, 0x10");
static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
-static char *bundle_id_prefix = NULL;
+char *bundle_id_prefix = NULL;
static char *server_bootstrap_name = NULL;
#define DEBUG 1