You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/11 11:23:30 UTC

[GitHub] kasjer closed pull request #1592: log: Add functions for log level manipulation

kasjer closed pull request #1592: log: Add functions for log level manipulation
URL: https://github.com/apache/mynewt-core/pull/1592
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sys/log/full/include/log/log.h b/sys/log/full/include/log/log.h
index ac7bc11909..f1162b4ff7 100644
--- a/sys/log/full/include/log/log.h
+++ b/sys/log/full/include/log/log.h
@@ -609,6 +609,23 @@ log_level_set(uint8_t module, uint8_t level)
 }
 #endif
 
+/**
+ * @brief Set log level for a logger.
+ *
+ * @param log                   The log to set level to.
+ * @param level                 New log level
+ */
+void log_set_level(struct log *log, uint8_t level);
+
+/**
+ * @brief Get log level for a logger.
+ *
+ * @param log                   The log to set level to.
+ *
+ * @return                      current value of log level.
+ */
+uint8_t log_get_level(const struct log *log);
+
 #if MYNEWT_VAL(LOG_STORAGE_INFO)
 /**
  * Return information about log storage
diff --git a/sys/log/full/src/log.c b/sys/log/full/src/log.c
index 343cb42579..6dcb50bccb 100644
--- a/sys/log/full/src/log.c
+++ b/sys/log/full/src/log.c
@@ -862,3 +862,17 @@ log_set_watermark(struct log *log, uint32_t index)
     return (rc);
 }
 #endif
+
+void
+log_set_level(struct log *log, uint8_t level)
+{
+    assert(log);
+    log->l_level = level;
+}
+
+uint8_t
+log_get_level(const struct log *log)
+{
+    assert(log);
+    return log->l_level;
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services