Merge branch 'master' of https://github.com/xenia-project/xenia into canary_experimental
This commit is contained in:
@@ -45,6 +45,7 @@ enum : uint32_t {
|
||||
Cpu = 4,
|
||||
};
|
||||
}
|
||||
|
||||
class LogSink {
|
||||
public:
|
||||
virtual ~LogSink() = default;
|
||||
@@ -81,14 +82,21 @@ void InitializeLogging(const std::string_view app_name);
|
||||
void ShutdownLogging();
|
||||
|
||||
namespace logging {
|
||||
namespace internal {
|
||||
|
||||
constexpr char kPrefixCharError = '!';
|
||||
constexpr char kPrefixCharWarning = 'w';
|
||||
constexpr char kPrefixCharInfo = 'i';
|
||||
constexpr char kPrefixCharDebug = 'd';
|
||||
|
||||
void ToggleLogLevel();
|
||||
|
||||
//bool ShouldLog(LogLevel log_level);
|
||||
bool ShouldLog(LogLevel log_level,
|
||||
uint32_t log_mask = xe::LogSrc::Uncategorized);
|
||||
namespace internal {
|
||||
|
||||
uint32_t GetLogLevel();
|
||||
std::pair<char*, size_t> GetThreadBuffer();
|
||||
|
||||
XE_NOALIAS
|
||||
void AppendLogLine(LogLevel log_level, const char prefix_char, size_t written);
|
||||
|
||||
@@ -167,26 +175,26 @@ struct LoggerBatch {
|
||||
|
||||
template <typename... Args>
|
||||
XE_COLD void XELOGE(std::string_view format, const Args&... args) {
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized,
|
||||
xe::LogLevel::Error, '!', format, args...);
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized, xe::LogLevel::Error,
|
||||
xe::logging::kPrefixCharError, format, args...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
XE_COLD void XELOGW(std::string_view format, const Args&... args) {
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized,
|
||||
xe::LogLevel::Warning, 'w', format, args...);
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized, xe::LogLevel::Warning,
|
||||
xe::logging::kPrefixCharWarning, format, args...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void XELOGI(std::string_view format, const Args&... args) {
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized,
|
||||
xe::LogLevel::Info, 'i', format, args...);
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized, xe::LogLevel::Info,
|
||||
xe::logging::kPrefixCharInfo, format, args...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void XELOGD(std::string_view format, const Args&... args) {
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized,
|
||||
xe::LogLevel::Debug, 'd', format, args...);
|
||||
xe::logging::AppendLogLineFormat(xe::LogSrc::Uncategorized, xe::LogLevel::Debug,
|
||||
xe::logging::kPrefixCharDebug, format, args...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
|
||||
Reference in New Issue
Block a user