Change in osmo-trx[master]: logger: allow disabling all logging at compile time

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Aug 25 09:36:16 UTC 2020


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/19804 )

Change subject: logger: allow disabling all logging at compile time
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-trx/+/19804/1/CommonLibs/Logger.h 
File CommonLibs/Logger.h:

https://gerrit.osmocom.org/c/osmo-trx/+/19804/1/CommonLibs/Logger.h@55 
PS1, Line 55: #define MAYBE_LOG(src, level) if (!log_check_level(src, level) || DISABLE_ALL_LOGGING) {} else
So there's two things here in the same patch:
1- For whatever reason you want to disable all logging
2- You want to avoid creating the object if there's gonna be no log due to loglevel.

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.

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.



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/19804
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I353ded020844eb4df7d7803785663789f8211d23
Gerrit-Change-Number: 19804
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Tue, 25 Aug 2020 09:36:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200825/f2a43c46/attachment.htm>


More information about the gerrit-log mailing list