[Bf-blender-cvs] [e301f938a18] soc-2020-info-editor: Cleanup: always use CLOG in names

Mateusz Grzeliński noreply at git.blender.org
Fri Aug 14 15:38:56 CEST 2020


Commit: e301f938a18214d8dbb3e2a3882d9dc95aae6542
Author: Mateusz Grzeliński
Date:   Fri Aug 14 09:19:14 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rBe301f938a18214d8dbb3e2a3882d9dc95aae6542

Cleanup: always use CLOG in names

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

M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/space_info/info_clog.c
M	source/blender/editors/space_info/info_draw_clog.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 743bb414b36..0d303f55c0f 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -180,8 +180,8 @@ static void blo_update_defaults_screen(bScreen *screen,
     else if (area->spacetype == SPACE_INFO) {
       SpaceInfo *sinfo = area->spacedata.first;
       sinfo->report_mask_exclude = RPT_DEBUG_ALL;
-      sinfo->log_severity_mask = CLG_DEFAULT_SEVERITY;
-      sinfo->log_format = INFO_LOG_FORMAT_DEFAULT;
+      sinfo->log_severity_mask = INFO_CLOG_SEVERITY_MASK_DEFAULT;
+      sinfo->log_format = INFO_CLOG_FORMAT_DEFAULT;
       sinfo->use_short_file_line = true;
     }
     else if (area->spacetype == SPACE_TEXT) {
diff --git a/source/blender/editors/space_info/info_clog.c b/source/blender/editors/space_info/info_clog.c
index 292f7fb36fb..6c684f0ea53 100644
--- a/source/blender/editors/space_info/info_clog.c
+++ b/source/blender/editors/space_info/info_clog.c
@@ -88,14 +88,14 @@ bool is_clog_record_visible(const CLG_LogRecord *record, const SpaceInfo *sinfo)
   }
 
   /* filter verbosity */
-  if (sinfo->use_log_filter & INFO_FILTER_LOG_LEVEL) {
+  if (sinfo->use_log_filter & INFO_FILTER_CLOG_LEVEL) {
     if (sinfo->filter_log_level < record->verbosity) {
       return false;
     }
   }
 
   /* filter log type */
-  if (sinfo->use_log_filter & INFO_FILTER_LOG_TYPE) {
+  if (sinfo->use_log_filter & INFO_FILTER_CLOG_TYPE) {
     LISTBASE_FOREACH (struct SpaceInfoFilter *, filter, &sinfo->filter_log_type) {
       if (!info_match_string_filter(filter->search_string,
                                     record->type->identifier,
@@ -108,7 +108,7 @@ bool is_clog_record_visible(const CLG_LogRecord *record, const SpaceInfo *sinfo)
   }
 
   /* filter log function */
-  if (sinfo->use_log_filter & INFO_FILTER_LOG_FUNCTION) {
+  if (sinfo->use_log_filter & INFO_FILTER_CLOG_FUNCTION) {
     LISTBASE_FOREACH (struct SpaceInfoFilter *, filter, &sinfo->filter_log_function) {
       if (!info_match_string_filter(filter->search_string,
                                     record->function,
@@ -121,7 +121,7 @@ bool is_clog_record_visible(const CLG_LogRecord *record, const SpaceInfo *sinfo)
   }
 
   /* filter file line */
-  if (sinfo->use_log_filter & INFO_FILTER_FILE_LINE) {
+  if (sinfo->use_log_filter & INFO_FILTER_CLOG_FILE_LINE) {
     LISTBASE_FOREACH (struct SpaceInfoFilter *, filter, &sinfo->filter_log_file_line) {
       if (!info_match_string_filter(filter->search_string,
                                     record->file_line,
diff --git a/source/blender/editors/space_info/info_draw_clog.c b/source/blender/editors/space_info/info_draw_clog.c
index 43a87ddaee9..4e1f56f4388 100644
--- a/source/blender/editors/space_info/info_draw_clog.c
+++ b/source/blender/editors/space_info/info_draw_clog.c
@@ -185,7 +185,7 @@ void clog_textview_line_get(struct TextViewContext *tvc,
   const SpaceInfo *sinfo = tvc->arg1;
 
   DynStr *dynStr = BLI_dynstr_new();
-  if (sinfo->log_format & INFO_LOG_SHOW_TIMESTAMP) {
+  if (sinfo->log_format & INFO_CLOG_SHOW_TIMESTAMP) {
     char timestamp_str[64];
     const uint64_t timestamp = record->timestamp;
     snprintf(timestamp_str,
@@ -195,7 +195,7 @@ void clog_textview_line_get(struct TextViewContext *tvc,
              (uint)(timestamp % 1000));
     BLI_dynstr_appendf(dynStr, "%s", timestamp_str);
   }
-  if (sinfo->log_format & INFO_LOG_SHOW_LEVEL) {
+  if (sinfo->log_format & INFO_CLOG_SHOW_LEVEL) {
     if (record->severity <= CLG_SEVERITY_VERBOSE) {
       BLI_dynstr_appendf(
           dynStr, "%s:%u ", clg_severity_as_text(record->severity), record->verbosity);
@@ -204,15 +204,15 @@ void clog_textview_line_get(struct TextViewContext *tvc,
       BLI_dynstr_appendf(dynStr, "%s ", clg_severity_as_text(record->severity));
     }
   }
-  if (sinfo->log_format & INFO_LOG_SHOW_LOG_TYPE) {
+  if (sinfo->log_format & INFO_CLOG_SHOW_LOG_TYPE) {
     BLI_dynstr_appendf(dynStr, "(%s) ", record->type->identifier);
   }
-  if (sinfo->log_format & INFO_LOG_SHOW_FILE_LINE) {
+  if (sinfo->log_format & INFO_CLOG_SHOW_FILE_LINE) {
     const char *file_line = (sinfo->use_short_file_line) ? BLI_path_basename(record->file_line) :
                                                            record->file_line;
     BLI_dynstr_appendf(dynStr, "%s ", file_line);
   }
-  if (sinfo->log_format & INFO_LOG_SHOW_FUNCTION) {
+  if (sinfo->log_format & INFO_CLOG_SHOW_FUNCTION) {
     BLI_dynstr_appendf(dynStr, "%s ", record->function);
   }
   if (sinfo->log_format & sinfo->use_log_message_new_line) {
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 6fdd5c38baf..3d230e9ff68 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -150,10 +150,10 @@ typedef struct SpaceInfo {
 
 /* SpaceInfo.use_log_filter */
 typedef enum eSpaceInfo_UseLogFilter {
-  INFO_FILTER_LOG_LEVEL = (1 << 0),
-  INFO_FILTER_FILE_LINE = (1 << 1),
-  INFO_FILTER_LOG_TYPE = (1 << 2),
-  INFO_FILTER_LOG_FUNCTION = (1 << 3),
+  INFO_FILTER_CLOG_LEVEL = (1 << 0),
+  INFO_FILTER_CLOG_FILE_LINE = (1 << 1),
+  INFO_FILTER_CLOG_TYPE = (1 << 2),
+  INFO_FILTER_CLOG_FUNCTION = (1 << 3),
 } eSpaceInfo_FilterMode;
 
 /* SpaceInfo.view */
@@ -172,21 +172,22 @@ typedef enum eSpaceInfo_LogSeverityMask {
   INFO_CLOG_SEVERITY_FATAL = (1 << 5),
 } eSpaceInfo_LogSeverityMask;
 
+#define INFO_CLOG_SEVERITY_MASK_DEFAULT INFO_CLOG_SEVERITY_MASK_ALL
 #define INFO_CLOG_SEVERITY_MASK_ALL \
   INFO_CLOG_SEVERITY_DEBUG | INFO_CLOG_SEVERITY_VERBOSE | INFO_CLOG_SEVERITY_INFO | \
       INFO_CLOG_SEVERITY_WARN | INFO_CLOG_SEVERITY_ERROR | INFO_CLOG_SEVERITY_FATAL
 
 /* SpaceInfo.log_format */
 typedef enum eSpaceInfo_logFormat {
-  INFO_LOG_SHOW_TIMESTAMP = (1 << 0),
-  INFO_LOG_SHOW_LOG_TYPE = (1 << 1),
-  INFO_LOG_SHOW_LEVEL = (1 << 2),
-  INFO_LOG_SHOW_FILE_LINE = (1 << 3),
-  INFO_LOG_SHOW_FUNCTION = (1 << 4),
+  INFO_CLOG_SHOW_TIMESTAMP = (1 << 0),
+  INFO_CLOG_SHOW_LOG_TYPE = (1 << 1),
+  INFO_CLOG_SHOW_LEVEL = (1 << 2),
+  INFO_CLOG_SHOW_FILE_LINE = (1 << 3),
+  INFO_CLOG_SHOW_FUNCTION = (1 << 4),
 } eSpaceInfo_logFormat;
 
-#define INFO_LOG_FORMAT_DEFAULT \
-  INFO_LOG_SHOW_LEVEL | INFO_LOG_SHOW_FILE_LINE | INFO_LOG_SHOW_FUNCTION
+#define INFO_CLOG_FORMAT_DEFAULT \
+  INFO_CLOG_SHOW_LEVEL | INFO_CLOG_SHOW_FILE_LINE | INFO_CLOG_SHOW_FUNCTION
 
 /** \} */
 
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 4f9783a9589..1b93a0a7803 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -6127,22 +6127,22 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   prop = RNA_def_property(srna, "use_log_level_filter", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_LOG_LEVEL);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_CLOG_LEVEL);
   RNA_def_property_ui_text(prop, "Use Log Level Filter", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   prop = RNA_def_property(srna, "use_log_file_line_filter", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_FILE_LINE);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_CLOG_FILE_LINE);
   RNA_def_property_ui_text(prop, "Use Log File Line Filter", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   prop = RNA_def_property(srna, "use_log_type_filter", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_LOG_TYPE);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_CLOG_TYPE);
   RNA_def_property_ui_text(prop, "Use Log Type Filter", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   prop = RNA_def_property(srna, "use_log_function_filter", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_LOG_FUNCTION);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_log_filter", INFO_FILTER_CLOG_FUNCTION);
   RNA_def_property_ui_text(prop, "Use Log Function Filter", "");
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
@@ -6179,11 +6179,11 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   static const EnumPropertyItem rna_enum_log_format_items[] = {
-      {INFO_LOG_SHOW_TIMESTAMP, "SHOW_TIMESTAMP", 0, "Show Timestamp", ""},
-      {INFO_LOG_SHOW_LOG_TYPE, "SHOW_LOG_TYPE", 0, "Show Log Type", ""},
-      {INFO_LOG_SHOW_LEVEL, "SHOW_LEVEL", 0, "Show Level", ""},
-      {INFO_LOG_SHOW_FILE_LINE, "SHOW_FILE_LINE", 0, "Show File with Line Number", ""},
-      {INFO_LOG_SHOW_FUNCTION, "SHOW_FUNCTION", 0, "Show Function Name", ""},
+      {INFO_CLOG_SHOW_TIMESTAMP, "SHOW_TIMESTAMP", 0, "Show Timestamp", ""},
+      {INFO_CLOG_SHOW_LOG_TYPE, "SHOW_LOG_TYPE", 0, "Show Log Type", ""},
+      {INFO_CLOG_SHOW_LEVEL, "SHOW_LEVEL", 0, "Show Level", ""},
+      {INFO_CLOG_SHOW_FILE_LINE, "SHOW_FILE_LINE", 0, "Show File with Line Number", ""},
+      {INFO_CLOG_SHOW_FUNCTION, "SHOW_FUNCTION", 0, "Show Function Name", ""},
       {0, NULL, 0, NULL, NULL},
   };
 
@@ -6192,7 +6192,7 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_property_enum_items(prop, rna_enum_log_format_items);
   RNA_def_property_ui_text(prop, "Log Printing format", "");
   RNA_def_property_flag(prop, PROP_ENUM_FLAG);
-  RNA_def_property_enum_default(prop, INFO_LOG_FORMAT_DEFAULT);
+  RNA_def_property_enum_default(prop, INFO_CLOG_FORMAT_DEFAULT);
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, NULL);
 
   static const EnumPropertyItem rna_enum_view_type_items[] = {



More information about the Bf-blender-cvs mailing list