]> sigrok.org Git - pulseview.git/commitdiff
Logging: Break srd stacktraces up into proper newlines
authorSoeren Apel <redacted>
Fri, 15 Nov 2019 18:08:35 +0000 (19:08 +0100)
committerSoeren Apel <redacted>
Sun, 24 Nov 2019 19:27:23 +0000 (20:27 +0100)
pv/logging.cpp

index b747ab5452c5f4ee7b2aef633a65fc1e02986f47..e42a9e54e94add49cb46b34f3a5ab216650e6c3f 100644 (file)
@@ -189,7 +189,10 @@ int Logging::log_srd(void *cb_data, int loglevel, const char *format, va_list ar
        va_end(args2);
 
        char *text = g_strdup_vprintf(format, args);
-       logging.log(QString::fromUtf8(text), LogSource_srd);
+
+       QString s = QString::fromUtf8(text);
+       for (QString& substring : s.split("\n", QString::SkipEmptyParts))
+                       logging.log(substring, LogSource_srd);
        g_free(text);
 
        return SR_OK;