log: add log level none

This commit is contained in:
raffarti 2018-01-23 09:29:46 +01:00
parent 6332312853
commit fedd97b8c0
2 changed files with 7 additions and 2 deletions

View file

@ -7,6 +7,9 @@ namespace dxvk {
Logger::Logger(const std::string& file_name)
: m_minLevel(getMinLogLevel())
{
if (m_minLevel == LogLevel::None)
return;
std::string path = env::getEnvVar(L"DXVK_LOG_PATH");
std::string file = path;
if (!file.empty() && *file.rbegin() != '/')
@ -64,12 +67,13 @@ namespace dxvk {
LogLevel Logger::getMinLogLevel() {
const std::array<std::pair<const char*, LogLevel>, 5> logLevels = {{
const std::array<std::pair<const char*, LogLevel>, 6> logLevels = {{
{ "trace", LogLevel::Trace },
{ "debug", LogLevel::Debug },
{ "info", LogLevel::Info },
{ "warn", LogLevel::Warn },
{ "error", LogLevel::Error },
{ "none", LogLevel::None },
}};
const std::string logLevelStr = env::getEnvVar(L"DXVK_LOG_LEVEL");

View file

@ -13,6 +13,7 @@ namespace dxvk {
Info = 2,
Warn = 3,
Error = 4,
None = 5,
};
/**
@ -49,4 +50,4 @@ namespace dxvk {
};
}
}