summaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-04-26 21:32:44 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-04-26 21:32:44 -0500
commit19e712625f1d67ec992891e31a8409086ff41e8c (patch)
treeba2d722e3111c0138c9b82951ea79ba7026e07d9 /dwl.c
parentb2960e53de2be5691ca2c741eb213523dea9f0db (diff)
options to select log level
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index bc1c614..b9d987d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1374,12 +1374,21 @@ xytomon(double x, double y)
int
main(int argc, char *argv[])
{
- wlr_log_init(WLR_INFO, NULL);
char *startup_cmd = NULL;
+ enum wlr_log_importance loglevel = WLR_ERROR;
int c;
- while ((c = getopt(argc, argv, "s:h")) != -1) {
+ while ((c = getopt(argc, argv, "qvds:h")) != -1) {
switch (c) {
+ case 'q':
+ loglevel = WLR_SILENT;
+ break;
+ case 'v':
+ loglevel = WLR_INFO;
+ break;
+ case 'd':
+ loglevel = WLR_DEBUG;
+ break;
case 's':
startup_cmd = optarg;
break;
@@ -1392,6 +1401,7 @@ main(int argc, char *argv[])
printf("Usage: %s [-s startup command]\n", argv[0]);
return EXIT_FAILURE;
}
+ wlr_log_init(loglevel, NULL);
/* The Wayland display is managed by libwayland. It handles accepting
* clients from the Unix socket, manging Wayland globals, and so on. */