On Mon, Aug 29, 2022 at 5:04 PM Moetaz Thabet <moetaztha...@gmail.com> wrote:
>
> this is the only comment that appeared in a red bar at the bottom of the 
> window. Is there a way i can send you the error log file ?

Argh. We use "report_error()" and I *thought* we ended up with
multiple lines there, but maybe we only show the last line. Very
annoying.

And kind of stupidly, we don't seem to log our errors anywhere, unlike
our SSRF_INFO informational things.

But that can't be true, and I must be missing something. Dirk will know.

What happens if you start subsurface from a terminal window with "-vv"
(for very verbose) as an argument? Do you get more data.

And Dirk, if we really don't log our 'report_error()' strings, maybe
something like the attached would make sense? I didn't follow the
whole chain of report_error() -> UI.

              Linus
 core/errorhelper.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/core/errorhelper.c b/core/errorhelper.c
index 36b58e264..42a917eb5 100644
--- a/core/errorhelper.c
+++ b/core/errorhelper.c
@@ -6,6 +6,7 @@
 #include <stdarg.h>
 #include "errorhelper.h"
 #include "membuffer.h"
+#include "qthelper.h"
 
 #define VA_BUF(b, fmt) do { va_list args; va_start(args, fmt); put_vformat(b, fmt, args); va_end(args); } while (0)
 
@@ -17,13 +18,13 @@ int report_error(const char *fmt, ...)
 {
 	struct membuffer buf = { 0 };
 
+	VA_BUF(&buf, fmt);
+	SSRF_INFO("error '%s'", mb_cstring(&buf));
+
 	/* if there is no error callback registered, don't produce errors */
 	if (!error_cb)
 		return -1;
-
-	VA_BUF(&buf, fmt);
 	error_cb(detach_cstring(&buf));
-
 	return -1;
 }
 
_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to