[Bf-blender-cvs] [3af40596c3a] soc-2020-info-editor: WIP: Create data structure for reporting logs

Mateusz Grzeliński noreply at git.blender.org
Thu Jun 25 13:42:57 CEST 2020


Commit: 3af40596c3a1f61ef4d6d507a7e9cda33446ad4d
Author: Mateusz Grzeliński
Date:   Thu Jun 25 13:42:44 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB3af40596c3a1f61ef4d6d507a7e9cda33446ad4d

WIP: Create data structure for reporting logs

===================================================================

M	intern/clog/CMakeLists.txt
M	intern/clog/clog.c

===================================================================

diff --git a/intern/clog/CMakeLists.txt b/intern/clog/CMakeLists.txt
index 41009642e3f..1724872202a 100644
--- a/intern/clog/CMakeLists.txt
+++ b/intern/clog/CMakeLists.txt
@@ -20,6 +20,7 @@ set(INC
   .
   ../atomic
   ../guardedalloc
+  ../../../source/blender/makesdna
 )
 
 set(INC_SYS
diff --git a/intern/clog/clog.c b/intern/clog/clog.c
index 921ee17a672..43df69f8811 100644
--- a/intern/clog/clog.c
+++ b/intern/clog/clog.c
@@ -50,6 +50,7 @@
 #include "MEM_guardedalloc.h"
 
 /* own include. */
+#include "../../source/blender/makesdna/DNA_listBase.h"
 #include "CLG_log.h"
 
 /* Local utility defines */
@@ -72,6 +73,17 @@ typedef struct CLG_IDFilter {
   char match[0];
 } CLG_IDFilter;
 
+typedef struct LogRecord {
+  /** track where does the log comes from */
+  CLG_LogType *type;
+  enum CLG_Severity severity;
+  uint64_t timestamp;
+  const char *file;
+  const char *line;
+  const char *function;
+  char *message;
+} LogRecord;
+
 typedef struct CLogContext {
   /** Single linked list of types.  */
   CLG_LogType *types;
@@ -101,6 +113,9 @@ typedef struct CLogContext {
     void (*fatal_fn)(void *file_handle);
     void (*backtrace_fn)(void *file_handle);
   } callbacks;
+
+  ListBase log_records;
+
 } CLogContext;
 
 /** \} */
@@ -382,6 +397,8 @@ static uint64_t clg_timestamp_ticks_get(void)
 /** \name Logging API
  * \{ */
 
+
+
 static void write_timestamp(CLogStringBuf *cstr, const uint64_t timestamp_tick_start)
 {
   char timestamp_str[64];
@@ -509,6 +526,8 @@ void CLG_logf(CLG_LogType *lg,
   int bytes_written = write(lg->ctx->output, cstr.data, cstr.len);
   (void)bytes_written;
 
+  //  BKE_reportf(reports, RPT_WARNING, "reported from logs");
+
   clg_str_free(&cstr);
 
   if (lg->ctx->callbacks.backtrace_fn) {



More information about the Bf-blender-cvs mailing list