cli: make libsigrokdecode follow loglevel setting
authorBert Vermeulen <bert@biot.com>
Mon, 9 Jan 2012 11:54:03 +0000 (12:54 +0100)
committerBert Vermeulen <bert@biot.com>
Mon, 9 Jan 2012 11:54:03 +0000 (12:54 +0100)
sigrok-cli.c

index 1d5d61c12e684d50e08d119a11c68e68cca13a9b..07dacfee0f67f75ae8a0a3228d20308df6e60600 100644 (file)
@@ -953,6 +953,13 @@ int main(int argc, char **argv)
                return 1;
        }
 
+       /* Set the loglevel (amount of messages to output) for libsigrokdecode. */
+       if (srd_set_loglevel(opt_loglevel) != SRD_OK) {
+               fprintf(stderr, "cli: %s: srd_set_loglevel(%d) failed\n",
+                       __func__, opt_loglevel);
+               return 1;
+       }
+
        if (sr_init() != SR_OK)
                return 1;