Removing redundant prefixes from PocketSphinx log output

This commit is contained in:
Daniel Wolf 2016-05-17 17:56:11 +02:00
parent c67e916185
commit f1563919e1
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ void sphinxLogCallback(void* user_data, err_lvl_t errorLevel, const char* format
success = charsWritten < static_cast<int>(chars.size()); success = charsWritten < static_cast<int>(chars.size());
if (!success) chars.resize(chars.size() * 2); if (!success) chars.resize(chars.size() * 2);
} }
string message(chars.data()); regex waste("^(DEBUG|INFO|INFOCONT|WARN|ERROR|FATAL): ");
string message = regex_replace(chars.data(), waste, "", std::regex_constants::format_first_only);
boost::algorithm::trim(message); boost::algorithm::trim(message);
logging::Level logLevel = ConvertSphinxErrorLevel(errorLevel); logging::Level logLevel = ConvertSphinxErrorLevel(errorLevel);