Merge pull request #7252 from Ebola16/Log

Android: Add Log Configuration to UI
This commit is contained in:
JosJuice
2020-08-02 22:00:48 +02:00
committed by GitHub
16 changed files with 222 additions and 6 deletions

View File

@ -239,6 +239,17 @@ bool LogManager::IsEnabled(LOG_TYPE type, LOG_LEVELS level) const
return m_log[type].m_enable && GetLogLevel() >= level;
}
std::map<std::string, std::string> LogManager::GetLogTypes()
{
std::map<std::string, std::string> log_types;
for (const auto& container : m_log)
{
log_types.emplace(container.m_short_name, container.m_full_name);
}
return log_types;
}
const char* LogManager::GetShortName(LOG_TYPE type) const
{
return m_log[type].m_short_name;

View File

@ -6,6 +6,7 @@
#include <array>
#include <cstdarg>
#include <map>
#include "Common/BitSet.h"
#include "Common/Logging/Log.h"
@ -47,6 +48,8 @@ public:
void SetEnable(LOG_TYPE type, bool enable);
bool IsEnabled(LOG_TYPE type, LOG_LEVELS level = LNOTICE) const;
std::map<std::string, std::string> GetLogTypes();
const char* GetShortName(LOG_TYPE type) const;
const char* GetFullName(LOG_TYPE type) const;