You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/10/20 18:50:45 UTC
incubator-mynewt-core git commit: sys/log - Fix incorrect condition
in level check.
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop 08cede0ac -> c3cdf9f18
sys/log - Fix incorrect condition in level check.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/c3cdf9f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c3cdf9f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c3cdf9f1
Branch: refs/heads/develop
Commit: c3cdf9f18aef27842558ed379b6f1dd9e079fcf4
Parents: 08cede0
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Oct 20 11:49:48 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Oct 20 11:50:42 2016 -0700
----------------------------------------------------------------------
sys/log/src/log.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c3cdf9f1/sys/log/src/log.c
----------------------------------------------------------------------
diff --git a/sys/log/src/log.c b/sys/log/src/log.c
index b8209ea..7bea910 100644
--- a/sys/log/src/log.c
+++ b/sys/log/src/log.c
@@ -112,11 +112,7 @@ log_register(char *name, struct log *log, const struct log_handler *lh,
log->l_name = name;
log->l_log = (struct log_handler *)lh;
log->l_arg = arg;
- if (level == 0) {
- log->l_level = LOG_SYSLEVEL;
- } else {
- log->l_level = level;
- }
+ log->l_level = level;
assert(!log_registered(log));
STAILQ_INSERT_TAIL(&g_log_list, log, l_next);
@@ -141,7 +137,7 @@ log_append(struct log *log, uint16_t module, uint16_t level, void *data,
* If the log message is below what this log instance is
* configured to accept, then just drop it.
*/
- if (level > log->l_level) {
+ if (level < log->l_level) {
rc = -1;
goto err;
}