[Bf-blender-cvs] [5878bfd0421] soc-2020-info-editor: Tweak log levels
Mateusz GrzeliÅski
noreply at git.blender.org
Wed Jul 8 15:14:48 CEST 2020
Commit: 5878bfd042127339e70f22f4aac66ef28fae78b7
Author: Mateusz Grzeliński
Date: Wed Jul 8 13:14:30 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB5878bfd042127339e70f22f4aac66ef28fae78b7
Tweak log levels
===================================================================
M source/blender/blenkernel/intern/report.c
M source/blender/makesrna/intern/makesrna.c
M source/blender/windowmanager/intern/wm_event_system.c
===================================================================
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index e08c237795a..4816e706832 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -64,27 +64,27 @@ const char *BKE_report_type_str(ReportType type)
}
}
-static int report_type_to_verbosity(ReportType type)
+static enum CLG_Severity report_type_to_severity(ReportType type)
{
switch (type) {
case RPT_INFO:
- return 5;
+ return CLG_SEVERITY_INFO;
case RPT_OPERATOR:
- return 4;
+ return CLG_SEVERITY_INFO;
case RPT_PROPERTY:
- return 3;
+ return CLG_SEVERITY_VERBOSE;
case RPT_WARNING:
- return 2;
+ return CLG_SEVERITY_INFO;
case RPT_ERROR:
- return 1;
+ return CLG_SEVERITY_ERROR;
case RPT_ERROR_INVALID_INPUT:
- return 1;
+ return CLG_SEVERITY_ERROR;
case RPT_ERROR_INVALID_CONTEXT:
- return 1;
+ return CLG_SEVERITY_ERROR;
case RPT_ERROR_OUT_OF_MEMORY:
- return 1;
+ return CLG_SEVERITY_ERROR;
default:
- return 0;
+ return CLG_SEVERITY_INFO;
}
}
@@ -152,12 +152,13 @@ void BKE_report(ReportList *reports, ReportType type, const char *_message)
int len;
const char *message = TIP_(_message);
- CLOG_VERBOSE(&LOG,
- report_type_to_verbosity(type),
- "ReportList(%p):%s: %s",
- reports,
- BKE_report_type_str(type),
- message);
+ CLOG_AT_SEVERITY(&LOG,
+ report_type_to_severity(type),
+ 0,
+ "ReportList(%p):%s: %s",
+ reports,
+ BKE_report_type_str(type),
+ message);
if (reports) {
char *message_alloc;
@@ -192,12 +193,13 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *_format, ...)
*/
if (CLOG_CHECK_IN_USE(&LOG)) {
char *message_cstring = BLI_dynstr_get_cstring(message);
- CLOG_VERBOSE(&LOG,
- report_type_to_verbosity(type),
- "ReportList(%p):%s: %s",
- reports,
- BKE_report_type_str(type),
- message_cstring);
+ CLOG_AT_SEVERITY(&LOG,
+ report_type_to_severity(type),
+ 0,
+ "ReportList(%p):%s: %s",
+ reports,
+ BKE_report_type_str(type),
+ message_cstring);
MEM_freeN(message_cstring);
}
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index b34c324bd91..70b58a436e4 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -5150,7 +5150,8 @@ int main(int argc, char **argv)
/* Some useful defaults since this runs standalone. */
CLG_output_use_basename_set(true);
- CLG_level_set(debugSRNA);
+ CLG_severity_level_set(CLG_SEVERITY_VERBOSE);
+ CLG_verbosity_level_set(debugSRNA);
if (argc < 2) {
fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 7a603351634..10f905435cb 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -861,10 +861,10 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca
}
if (retval & OPERATOR_FINISHED) {
- CLOG_STR_VERBOSE_N(WM_LOG_OPERATORS, 1, WM_operator_pystring(C, op, false, true));
+ CLOG_STR_INFO_N(WM_LOG_OPERATORS, WM_operator_pystring(C, op, false, true));
if (caller_owns_reports == false) {
- CLOG_STR_VERBOSE_N(WM_LOG_OPERATORS, 2, BKE_reports_sprintfN(op->reports, 0));
+ CLOG_STR_VERBOSE_N(WM_LOG_OPERATORS, 1, BKE_reports_sprintfN(op->reports, 0));
}
if (op->type->flag & OPTYPE_REGISTER) {
More information about the Bf-blender-cvs
mailing list