summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-12-16 14:14:41 +0100
committerLars-Dominik Braun <lars@6xq.net>2020-08-09 08:42:11 +0200
commitbc6bd8a2b8b84a79dd77b81d6a25b661c5d1d1ca (patch)
tree3013cbf73ea3374d9974d251e11da87be7d1276b /src/main.c
parent7f6457aa9b7110869e89111c42651b1055728679 (diff)
downloadpianobar-bc6bd8a2b8b84a79dd77b81d6a25b661c5d1d1ca.tar.gz
pianobar-bc6bd8a2b8b84a79dd77b81d6a25b661c5d1d1ca.tar.bz2
pianobar-bc6bd8a2b8b84a79dd77b81d6a25b661c5d1d1ca.zip
Add optional debugging code
Compile *without* -DNDEBUG. The environment variable PIANOBAR_DEBUG accepts a bitfield which enables (1) network (2) audio (4) UI debug messages.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6388cde..de09fb7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -51,6 +51,7 @@ THE SOFTWARE.
#include <piano.h>
#include "main.h"
+#include "debug.h"
#include "terminal.h"
#include "ui.h"
#include "ui_dispatch.h"
@@ -401,6 +402,7 @@ sig_atomic_t *interrupted = NULL;
static void intHandler (int signal) {
if (interrupted != NULL) {
+ debugPrint(DEBUG_UI, "Received ^C\n");
*interrupted += 1;
}
}
@@ -417,6 +419,8 @@ static void BarMainSetupSigaction () {
int main (int argc, char **argv) {
static BarApp_t app;
+ debugEnable();
+
memset (&app, 0, sizeof (app));
/* save terminal attributes, before disabling echoing */