spdlog: handle log level with MANGOHUD_LOG_LEVEL

pull/1151/head
FlightlessMango 7 months ago
parent f40b32fc45
commit 544856b174

@ -27,14 +27,9 @@ pre_args = [
'-DSPDLOG_COMPILED_LIB'
]
# Define DEBUG for debug builds only (debugoptimized is not included on this one)
if get_option('buildtype') == 'debug'
pre_args += '-DDEBUG'
pre_args += '-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE'
else
pre_args += '-DNDEBUG'
pre_args += '-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_' + get_option('loglevel').to_upper()
endif
# Always set max spdlog level, handle this using MANGOHUD_LOG_LEVEL instead.
pre_args += '-DDEBUG'
pre_args += '-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE'
# TODO: this is very incomplete
is_unixy = false

@ -88,6 +88,10 @@ void init_spdlog()
spdlog::set_level(spdlog::level::from_str(log_level));
}
}
} 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));
}
}

Loading…
Cancel
Save