From 4dbc450d011af2ad0ffbc6231dd5f2c9de63be26 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 12 Feb 2018 11:07:38 +0100 Subject: [PATCH] Enable debug logs only for debug builds In release mode, use the default log priorities. --- app/meson.build | 3 +++ app/src/main.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/meson.build b/app/meson.build index 87dbcff3..cada95f7 100644 --- a/app/meson.build +++ b/app/meson.build @@ -35,6 +35,9 @@ dependencies = [ conf = configuration_data() +# expose the build type +conf.set('BUILD_DEBUG', get_option('buildtype') == 'debug') + # the version, updated on release conf.set_quoted('SCRCPY_VERSION', '0.1') diff --git a/app/src/main.c b/app/src/main.c index c1e02e2e..852815e1 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -231,7 +231,9 @@ int main(int argc, char *argv[]) { return 1; } +#ifdef BUILD_DEBUG SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG); +#endif int res = scrcpy(args.serial, args.port, args.max_size, args.bit_rate) ? 0 : 1;