Add CLI flag for verbose logging
This commit is contained in:
parent
586b0eec7a
commit
194a090d92
5 changed files with 17 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ If a change only affects particular applications, they are listed in parentheses
|
|||
- feat(buffyboard): Add fbdev force-refresh quirk via config
|
||||
- feat(buffyboard): Allow disabling input devices via config
|
||||
- feat(buffyboard): Add CLI flags for overriding geometry & DPI
|
||||
- feat(buffyboard): Add CLI flag for verbose logging
|
||||
- fix(unl0kr): Shutdown message box doesn't close on decline
|
||||
- fix(unl0kr): Shutdown message box buttons and label are unstyled
|
||||
- fix(unl0kr): Build fails when DRM is disabled
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ Mandatory arguments to long options are mandatory for short options too.
|
|||
* 2 - upside down orientation (180 degrees)
|
||||
* 3 - counterclockwise orientation (270 degrees)
|
||||
-h, --help Print this message and exit
|
||||
-v, --verbose Enable more detailed logging output on STDERR
|
||||
-V, --version Print the buffyboard version and exit
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ static void init_opts(bb_cli_opts *opts) {
|
|||
opts->y_offset = 0;
|
||||
opts->dpi = 0;
|
||||
opts->rotation = LV_DISPLAY_ROTATION_0;
|
||||
opts->verbose = false;
|
||||
}
|
||||
|
||||
static void print_usage() {
|
||||
|
|
@ -71,6 +72,7 @@ static void print_usage() {
|
|||
" * 2 - upside down orientation (180 degrees)\n"
|
||||
" * 3 - counterclockwise orientation (270 degrees)\n"
|
||||
" -h, --help Print this message and exit\n"
|
||||
" -v, --verbose Enable more detailed logging output on STDERR\n"
|
||||
" -V, --version Print the buffyboard version and exit\n");
|
||||
/*-------------------------------- 78 CHARS --------------------------------*/
|
||||
}
|
||||
|
|
@ -89,13 +91,14 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) {
|
|||
{ "dpi", required_argument, NULL, 'd' },
|
||||
{ "rotate", required_argument, NULL, 'r' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "verbose", no_argument, NULL, 'v' },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
int opt, index = 0;
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "C:g:d:r:hV", long_opts, &index)) != -1) {
|
||||
while ((opt = getopt_long(argc, argv, "C:g:d:r:hvV", long_opts, &index)) != -1) {
|
||||
switch (opt) {
|
||||
case 'C':
|
||||
opts->config_files = realloc(opts->config_files, (opts->num_config_files + 1) * sizeof(char *));
|
||||
|
|
@ -145,6 +148,9 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) {
|
|||
case 'h':
|
||||
print_usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'v':
|
||||
opts->verbose = true;
|
||||
break;
|
||||
case 'V':
|
||||
fprintf(stderr, "buffyboard %s\n", BB_VERSION);
|
||||
exit(0);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ typedef struct {
|
|||
int dpi;
|
||||
/* Display rotation */
|
||||
lv_display_rotation_t rotation;
|
||||
/* Verbose mode. If true, provide more detailed logging output on STDERR. */
|
||||
bool verbose;
|
||||
} bb_cli_opts;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "lvgl/lvgl.h"
|
||||
|
||||
#include "../shared/indev.h"
|
||||
#include "../shared/log.h"
|
||||
#include "../shared/theme.h"
|
||||
#include "../shared/themes.h"
|
||||
#include "../squeek2lvgl/sq2lv.h"
|
||||
|
|
@ -180,6 +181,11 @@ int main(int argc, char *argv[]) {
|
|||
/* Parse command line options */
|
||||
bb_cli_parse_opts(argc, argv, &cli_opts);
|
||||
|
||||
/* Set up log level */
|
||||
if (cli_opts.verbose) {
|
||||
bbx_log_set_level(BBX_LOG_LEVEL_VERBOSE);
|
||||
}
|
||||
|
||||
/* Parse config files */
|
||||
bb_config_init_opts(&conf_opts);
|
||||
bb_config_parse_file("/etc/buffyboard.conf", &conf_opts);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue