Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-04 09:02:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-04 09:02:11 +0300
commiteeab3563d7409409a70bfdd4fcdb4ddfee428af3 (patch)
tree562d7f5207b9a8e1e28b5ad2bfa8c9a1faa450a0
parentb3545ae37352ec440ee8fece0cd9c66289ebe52f (diff)
parentc7cfee04c4dd9dcafebe1659d7f7cf1ffd7ff14e (diff)
Merge branch 'master' into blender2.8
-rw-r--r--intern/clog/CLG_log.h2
-rw-r--r--intern/clog/clog.c14
-rw-r--r--source/creator/creator_args.c7
3 files changed, 21 insertions, 2 deletions
diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h
index 8afa9edd75b..ff8f983b10c 100644
--- a/intern/clog/CLG_log.h
+++ b/intern/clog/CLG_log.h
@@ -150,6 +150,8 @@ void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle));
void CLG_type_filter_include(const char *type_filter, int type_filter_len);
void CLG_type_filter_exclude(const char *type_filter, int type_filter_len);
+void CLG_level_set(int level);
+
void CLG_logref_init(CLG_LogRef *clg_ref);
/** Declare outside function, declare as extern in header. */
diff --git a/intern/clog/clog.c b/intern/clog/clog.c
index dc0229e0748..e93ba9ec2b7 100644
--- a/intern/clog/clog.c
+++ b/intern/clog/clog.c
@@ -492,6 +492,14 @@ static void CLG_ctx_type_filter_include(CLogContext *ctx, const char *type_match
clg_ctx_type_filter_append(&ctx->filters[1], type_match, type_match_len);
}
+static void CLG_ctx_level_set(CLogContext *ctx, int level)
+{
+ ctx->default_type.level = level;
+ for (CLG_LogType *ty = ctx->types; ty; ty = ty->next) {
+ ty->level = level;
+ }
+}
+
static CLogContext *CLG_ctx_init(void)
{
CLogContext *ctx = MEM_callocN(sizeof(*ctx), __func__);
@@ -569,6 +577,12 @@ void CLG_type_filter_include(const char *type_match, int type_match_len)
CLG_ctx_type_filter_include(g_ctx, type_match, type_match_len);
}
+void CLG_level_set(int level)
+{
+ CLG_ctx_level_set(g_ctx, level);
+}
+
+
/** \} */
/* -------------------------------------------------------------------- */
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 60f0ae9c543..5d49c954522 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -710,8 +710,11 @@ static int arg_handle_log_level_set(int argc, const char **argv, void *UNUSED(da
if (!parse_int_clamp(argv[1], NULL, -1, INT_MAX, &G.log.level, &err_msg)) {
printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]);
}
- if (G.log.level == -1) {
- G.log.level = INT_MAX;
+ else {
+ if (G.log.level == -1) {
+ G.log.level = INT_MAX;
+ }
+ CLG_level_set(G.log.level);
}
return 1;
}