<p style="white-space: pre-wrap; word-wrap: break-word;">This change is ready for review.</p><p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/15539">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/15539/3/src/common/logging.c">File src/common/logging.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15539/3/src/common/logging.c@148">Patch Set #3, Line 148:</a> <code style="font-family:monospace,monospace">static int filter_fn(const struct log_context *ctx, struct log_target *tgt)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(personally would prefer "osmo_bts_filter_fn()" to not overload other generally named filter_fn()s for easier grepping)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15539/3/src/common/logging.c@158">Patch Set #3, Line 158:</a> <code style="font-family:monospace,monospace">return 1;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">In OsmoBSC, and even in a libosmocore test, the return values are inverted... […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Looking at osmo_bsc_main.c filter_fn(), it seems that the intention is this:</p><p style="white-space: pre-wrap; word-wrap: break-word;">"Normally", we set 'logging set filter all 1' to see all logging,<br>so should_log_to_target() exits with true before even asking filter_fn()s.</p><p style="white-space: pre-wrap; word-wrap: break-word;">But in case of 'filter all 0', then everything is considered switched off.<br>From this baseline, specific filters can explicitly enable logging to "re-appear":</p><p style="white-space: pre-wrap; word-wrap: break-word;">If no filter is set, then you should return 0 -- it remains off.<br>If a filter is set and it matches, return 1:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        if ((tgt->filter_map & (1 << LOG_FLT_L1_SAPI)) != 0<br>          && sapi_mask && sapi<br>          && (*sapi_mask & (1 << *sapi)) != 0)<br>            return 1;<br>     <br>      return 0;</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Again, compare osmo_bsc_main.c filter_fn().</p><p style="white-space: pre-wrap; word-wrap: break-word;"><Insert rant here that the current filter stuff is insanely hard to get right on so many levels></p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/15539">change 15539</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/15539"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6b7bb2e1d61502b61214f854a4ec5cbb7267545b </div>
<div style="display:none"> Gerrit-Change-Number: 15539 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 18 Sep 2019 01:18:37 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Comment-In-Reply-To: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>