Logging: Add a flag to specify the minimum log level

--log_level = (0=error, 1=warning, 2=info, 3=debug)
This commit is contained in:
DrChat
2017-03-24 16:28:41 -05:00
parent 92a4b90ed0
commit e699be0118
6 changed files with 85 additions and 41 deletions

View File

@@ -450,9 +450,11 @@ void PrintKernelCall(cpu::Export* export_entry, const Tuple& params) {
AppendKernelCallParams(string_buffer, export_entry, params);
string_buffer.Append(')');
if (export_entry->tags & xe::cpu::ExportTag::kImportant) {
xe::LogLine('i', string_buffer.GetString(), string_buffer.length());
xe::LogLine(xe::LogLevel::LOG_LEVEL_INFO, 'i', string_buffer.GetString(),
string_buffer.length());
} else {
xe::LogLine('d', string_buffer.GetString(), string_buffer.length());
xe::LogLine(xe::LogLevel::LOG_LEVEL_DEBUG, 'd', string_buffer.GetString(),
string_buffer.length());
}
}