Print prefixed output in a single call to rdclogprint_int

* On android each call to rdclogprint_int goes onto its own line in the logcat
  output, so we need to combine the prefix externally.
This commit is contained in:
baldurk
2019-02-15 11:55:51 +00:00
parent 9ee4795948
commit 69dc9f8031
+8 -6
View File
@@ -511,9 +511,10 @@ void rdclog_direct(time_t utcTime, uint32_t pid, LogType type, const char *proje
write_newline(nl);
if(!first)
rdclogprint_int(type, prefixText.c_str(), prefixText.c_str());
rdclogprint_int(type, base, noPrefixOutput);
if(first)
rdclogprint_int(type, base, noPrefixOutput);
else
rdclogprint_int(type, (prefixText + base).c_str(), noPrefixOutput);
// restore the characters
nl[1] = backup[0];
@@ -530,9 +531,10 @@ void rdclog_direct(time_t utcTime, uint32_t pid, LogType type, const char *proje
// append final newline and write the last line
write_newline(output);
if(!first)
rdclogprint_int(type, prefixText.c_str(), prefixText.c_str());
rdclogprint_int(type, base, noPrefixOutput);
if(first)
rdclogprint_int(type, base, noPrefixOutput);
else
rdclogprint_int(type, (prefixText + base).c_str(), noPrefixOutput);
}
SAFE_DELETE_ARRAY(oversizedBuffer);