<p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/19804">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/19804/1/CommonLibs/Logger.h">File CommonLibs/Logger.h:</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/osmo-trx/+/19804/1/CommonLibs/Logger.h@55">Patch Set #1, Line 55:</a> <code style="font-family:monospace,monospace">#define MAYBE_LOG(src, level) if (!log_check_level(src, level) || DISABLE_ALL_LOGGING) {} else</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So there's two things here in the same patch:<br>1- For whatever reason you want to disable all logging<br>2- You want to avoid creating the object if there's gonna be no log due to loglevel.</p><p style="white-space: pre-wrap; word-wrap: break-word;">First of all, the construction you use here with the if else is deferring checks to the compiler for no good reason. Simply use #ifdef DISABLE_ALL_LOGGING and if defined, then define all the LOG* macros as empty.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think nowadays there's probably not a real good use for having to create objects every time, and I'd go better for refactoring the logging code to drop the object, and implement it as functions or macros. That's probably going to improve the efficiency.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/19804">change 19804</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-trx/+/19804"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I353ded020844eb4df7d7803785663789f8211d23 </div>
<div style="display:none"> Gerrit-Change-Number: 19804 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 25 Aug 2020 09:36:16 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>