[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/09: runtime: expose set_log_level for hi
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/09: runtime: expose set_log_level for hier_blocks |
Date: |
Sat, 6 Aug 2016 22:28:35 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch next
in repository gnuradio.
commit c8ffbf08723f10a2455d3de9e04f8a94bbf70c15
Author: Nathan West <address@hidden>
Date: Wed Apr 27 02:29:43 2016 -0400
runtime: expose set_log_level for hier_blocks
---
gnuradio-runtime/include/gnuradio/basic_block.h | 3 +++
gnuradio-runtime/include/gnuradio/hier_block2.h | 20 ++++++++++++++++++++
gnuradio-runtime/lib/hier_block2.cc | 6 ++++++
gnuradio-runtime/lib/hier_block2_detail.cc | 10 ++++++++++
gnuradio-runtime/lib/hier_block2_detail.h | 2 ++
gnuradio-runtime/swig/hier_block2.i | 2 ++
6 files changed, 43 insertions(+)
diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h
b/gnuradio-runtime/include/gnuradio/basic_block.h
index fa454c9..6e9b1ff 100644
--- a/gnuradio-runtime/include/gnuradio/basic_block.h
+++ b/gnuradio-runtime/include/gnuradio/basic_block.h
@@ -377,6 +377,9 @@ namespace gr {
virtual std::vector<int> processor_affinity()
{ throw std::runtime_error("processor_affinity not overloaded in child
class."); }
+
+ virtual void set_log_level(std::string level)
+ { throw std::runtime_error("set_log_level not overloaded in child
class."); }
};
inline bool operator<(basic_block_sptr lhs, basic_block_sptr rhs)
diff --git a/gnuradio-runtime/include/gnuradio/hier_block2.h
b/gnuradio-runtime/include/gnuradio/hier_block2.h
index 08a5389..6666906 100644
--- a/gnuradio-runtime/include/gnuradio/hier_block2.h
+++ b/gnuradio-runtime/include/gnuradio/hier_block2.h
@@ -267,6 +267,26 @@ namespace gr {
std::vector<int> processor_affinity();
/*!
+ * \brief Set the logger's output level.
+ *
+ * Sets the level of the logger for all connected blocks. This takes
+ * a string that is translated to the standard levels and can be
+ * (case insensitive):
+ *
+ * \li off , notset
+ * \li debug
+ * \li info
+ * \li notice
+ * \li warn
+ * \li error
+ * \li crit
+ * \li alert
+ * \li fatal
+ * \li emerg
+ */
+ void set_log_level(std::string level);
+
+ /*!
* \brief Get if all block min buffers should be set.
*
* \details this returns whether all the block min output buffers
diff --git a/gnuradio-runtime/lib/hier_block2.cc
b/gnuradio-runtime/lib/hier_block2.cc
index 597ae03..c9798c4 100644
--- a/gnuradio-runtime/lib/hier_block2.cc
+++ b/gnuradio-runtime/lib/hier_block2.cc
@@ -178,6 +178,12 @@ namespace gr {
return d_detail->processor_affinity();
}
+ void
+ hier_block2::set_log_level(std::string level)
+ {
+ d_detail->set_log_level(level);
+ }
+
std::string
dot_graph(hier_block2_sptr hierblock2)
{
diff --git a/gnuradio-runtime/lib/hier_block2_detail.cc
b/gnuradio-runtime/lib/hier_block2_detail.cc
index 0d0ddf55..93fc67d 100644
--- a/gnuradio-runtime/lib/hier_block2_detail.cc
+++ b/gnuradio-runtime/lib/hier_block2_detail.cc
@@ -956,4 +956,14 @@ namespace gr {
return tmp[0]->processor_affinity();
}
+ void
+ hier_block2_detail::set_log_level(std::string level)
+ {
+ basic_block_vector_t tmp = d_fg->calc_used_blocks();
+ for(basic_block_viter_t p = tmp.begin(); p != tmp.end(); p++) {
+ (*p)->set_log_level(level);
+ }
+ }
+
+
} /* namespace gr */
diff --git a/gnuradio-runtime/lib/hier_block2_detail.h
b/gnuradio-runtime/lib/hier_block2_detail.h
index a5584fe..0298d39 100644
--- a/gnuradio-runtime/lib/hier_block2_detail.h
+++ b/gnuradio-runtime/lib/hier_block2_detail.h
@@ -57,6 +57,8 @@ namespace gr {
void set_processor_affinity(const std::vector<int> &mask);
void unset_processor_affinity();
std::vector<int> processor_affinity();
+
+ void set_log_level(std::string level);
// Track output buffer min/max settings
std::vector<size_t> d_max_output_buffer;
diff --git a/gnuradio-runtime/swig/hier_block2.i
b/gnuradio-runtime/swig/hier_block2.i
index 12190d0..4bf2839 100644
--- a/gnuradio-runtime/swig/hier_block2.i
+++ b/gnuradio-runtime/swig/hier_block2.i
@@ -91,6 +91,8 @@ namespace gr {
void unset_processor_affinity();
std::vector<int> processor_affinity();
+ void set_log_level(std::string level);
+
// Methods to manage block's min/max buffer sizes.
size_t max_output_buffer(int i);
void set_max_output_buffer(size_t max_output_buffer);
- [Commit-gnuradio] [gnuradio] branch next updated (675afc0 -> fc1a6a8), git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 03/09: runtime: expose set_log_level for hier_blocks,
git <=
- [Commit-gnuradio] [gnuradio] 07/09: Merge branch 'master' into next, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 09/09: Merge remote-tracking branch 'pinkavaj/argparse-utils-04-b' into next, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 05/09: blocks: add QA for new block log_level accessors, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 01/09: runtime: expose set_log_level for blocks, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 02/09: runtime: add documentation for block set_log_level, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 08/09: Merge remote-tracking branch 'nwest/block-log_set_level' into next, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 04/09: runtime: add interface to get log_level for blocks, git, 2016/08/06
- [Commit-gnuradio] [gnuradio] 06/09: filter: replace OptionParser by ArgumentParser for gr-utils and gr-qtgui, git, 2016/08/06