This is an automated email from the ASF dual-hosted git repository.
vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
The following commit(s) were added to refs/heads/master by this push:
new 5f2be3d cmd/log_mgmt: Remove support for LOG_VERSION 2
new b97582a Merge pull request #55 from vrahane/remove_log_version_2
5f2be3d is described below
commit 5f2be3d07d28ec4dc4da33f1e2797b90d172d2f1
Author: Vipul Rahane <[email protected]>
AuthorDate: Wed Jan 15 14:08:01 2020 -0800
cmd/log_mgmt: Remove support for LOG_VERSION 2
---
cmd/img_mgmt/port/mynewt/src/mynewt_img_mgmt_log.c | 3 +--
cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c | 5 -----
cmd/log_mgmt/src/log_mgmt.c | 9 ---------
3 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/cmd/img_mgmt/port/mynewt/src/mynewt_img_mgmt_log.c
b/cmd/img_mgmt/port/mynewt/src/mynewt_img_mgmt_log.c
index ad4cfd8..c74d8b8 100644
--- a/cmd/img_mgmt/port/mynewt/src/mynewt_img_mgmt_log.c
+++ b/cmd/img_mgmt/port/mynewt/src/mynewt_img_mgmt_log.c
@@ -71,8 +71,7 @@
static int
img_mgmt_log_gen(const char *ev, int status, const uint8_t *hash)
{
-#if MYNEWT_VAL(LOG_VERSION) > 2 && \
- LOG_MOD_LEVEL_IS_ACTIVE(MYNEWT_VAL(IMG_MGMT_LOG_LVL), LOG_LEVEL_INFO)
+#if LOG_MOD_LEVEL_IS_ACTIVE(MYNEWT_VAL(IMG_MGMT_LOG_LVL), LOG_LEVEL_INFO)
struct os_mbuf *om;
int rc;
diff --git a/cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c
b/cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c
index 33dd774..6bdf6fb 100644
--- a/cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c
+++ b/cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c
@@ -192,15 +192,10 @@ mynewt_log_mgmt_walk_cb(struct log *log, struct
log_offset *log_offset,
entry.module = leh->ue_module;
entry.level = leh->ue_level;
-#if MYNEWT_VAL(LOG_VERSION) < 3
- entry.type = LOG_ETYPE_STRING;
- entry.flags = 0;
-#else
entry.type = leh->ue_etype;
entry.flags = leh->ue_flags;
entry.imghash = (leh->ue_flags & LOG_FLAGS_IMG_HASH) ?
leh->ue_imghash : NULL;
-#endif
entry.len = len;
entry.data = mynewt_log_mgmt_walk_arg->chunk;
diff --git a/cmd/log_mgmt/src/log_mgmt.c b/cmd/log_mgmt/src/log_mgmt.c
index 42343a5..9f24b72 100644
--- a/cmd/log_mgmt/src/log_mgmt.c
+++ b/cmd/log_mgmt/src/log_mgmt.c
@@ -95,7 +95,6 @@ log_mgmt_encode_entry(CborEncoder *enc, const struct
log_mgmt_entry *entry,
if (entry->offset == 0) {
err |= cbor_encoder_create_map(enc, &lmec->mapenc,
CborIndefiniteLength);
-#if MYNEWT_VAL(LOG_VERSION) > 2
switch (entry->type) {
case LOG_MGMT_ETYPE_CBOR:
err |= cbor_encode_text_stringz(&lmec->mapenc, "type");
@@ -112,7 +111,6 @@ log_mgmt_encode_entry(CborEncoder *enc, const struct
log_mgmt_entry *entry,
default:
return LOG_MGMT_ERR_ECORRUPT;
}
-#endif
err |= cbor_encode_text_stringz(&lmec->mapenc, "ts");
err |= cbor_encode_int(&lmec->mapenc, entry->ts);
err |= cbor_encode_text_stringz(&lmec->mapenc, "level");
@@ -127,7 +125,6 @@ log_mgmt_encode_entry(CborEncoder *enc, const struct
log_mgmt_entry *entry,
LOG_MGMT_IMG_HASHLEN);
}
-#if MYNEWT_VAL(LOG_VERSION) > 2
err |= cbor_encode_text_stringz(&lmec->mapenc, "msg");
/*
@@ -150,10 +147,6 @@ log_mgmt_encode_entry(CborEncoder *enc, const struct
log_mgmt_entry *entry,
err |= cbor_encode_byte_string(&lmec->msgenc, entry->data,
entry->chunklen);
bytes_encoded = entry->chunklen;
}
-#else
- err |= cbor_encode_text_stringz(&lmec->mapenc, "msg");
- err |= cbor_encode_text_stringz(&lmec->mapenc, (char *)data);
-#endif
} else {
/*
* The else case is executed for non-first chunks of data to be encoded
@@ -230,9 +223,7 @@ log_mgmt_cb_encode(struct log_mgmt_entry *entry, void *arg)
* message in the "msg" field of the response
*/
if (ctxt->counter == 0) {
-#if MYNEWT_VAL(LOG_VERSION) > 2
entry->type = LOG_ETYPE_STRING;
-#endif
snprintf((char *)entry->data, LOG_MGMT_MAX_RSP_LEN,
"error: entry too large (%zu bytes)", entry_len);
}