meson: define DEBUG if debug

pull/1151/head
FlightlessMango 7 months ago
parent 5f05f67e22
commit 363b6530cf

@ -28,7 +28,9 @@ pre_args = [
]
# Always set max spdlog level, handle this using MANGOHUD_LOG_LEVEL instead.
pre_args += '-DDEBUG'
if get_option('buildtype') == 'debug'
pre_args += '-DDEBUG'
endif
pre_args += '-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE'
# TODO: this is very incomplete

@ -72,7 +72,7 @@ void init_spdlog()
SPDLOG_ERROR("{}", ex.what());
}
}
#ifndef NDEBUG
#ifdef DEBUG
spdlog::set_level(spdlog::level::level_enum::debug);
#endif
spdlog::cfg::load_env_levels();
@ -88,10 +88,12 @@ void init_spdlog()
spdlog::set_level(spdlog::level::from_str(log_level));
}
}
#ifndef DEBUG
} else {
std::string log_level = "err";
transform(log_level.begin(), log_level.end(), log_level.begin(), ::tolower);
spdlog::set_level(spdlog::level::from_str(log_level));
#endif
}
}

Loading…
Cancel
Save