Commit 1d85eecd 1d85eecdc90a19ca4a59f6642f43fedee3c12cd3 by Sergey Poznyakoff

Added configurable debugging.

1 parent 56f5f349
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
20 #ifdef WITH_GUILE 20 #ifdef WITH_GUILE
21 #include <mu_scm.h> 21 #include <mu_scm.h>
22 22
23 int debug_guile;
24
23 SCM mda_catch_body (void *data, mailbox_t mbox); 25 SCM mda_catch_body (void *data, mailbox_t mbox);
24 SCM mda_catch_handler (void *unused, SCM tag, SCM throw_args); 26 SCM mda_catch_handler (void *unused, SCM tag, SCM throw_args);
25 int mda_next (void *data, mailbox_t mbox); 27 int mda_next (void *data, mailbox_t mbox);
...@@ -46,7 +48,7 @@ prog_mda (struct mda_data *data) ...@@ -46,7 +48,7 @@ prog_mda (struct mda_data *data)
46 48
47 unlink (data->tempfile); 49 unlink (data->tempfile);
48 50
49 param.debug_guile = 1 /*FIXME*/; 51 param.debug_guile = debug_guile;
50 param.mbox = mbox; 52 param.mbox = mbox;
51 param.user_name = NULL; 53 param.user_name = NULL;
52 param.init = mda_init; 54 param.init = mda_init;
...@@ -75,7 +77,8 @@ mda_catch_body (void *data, mailbox_t mbox) ...@@ -75,7 +77,8 @@ mda_catch_body (void *data, mailbox_t mbox)
75 77
76 if (access (md->progfile, R_OK)) 78 if (access (md->progfile, R_OK))
77 { 79 {
78 syslog (LOG_ERR, "access to %s failed: %m", md->progfile); 80 if (debug_level > 2)
81 syslog (LOG_DEBUG, "access to %s failed: %m", md->progfile);
79 } 82 }
80 else 83 else
81 scm_primitive_load (scm_makfrom0str (md->progfile)); 84 scm_primitive_load (scm_makfrom0str (md->progfile));
......