Attention is currently required from: fixeria. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/36545?usp=email )
Change subject: formalize log subsys stripping for vty ...................................................................... Patch Set 1: (2 comments) File src/core/logging.c: https://gerrit.osmocom.org/c/libosmocore/+/36545/comment/abd53216_0a83c47e PS1, Line 432: int cat_idx > probably a good idea to make it `unsigned` TL;DR: I'll move it to a private header. rambling on in case you're interested: it ended up this way because - intended for private API use only, i'd have liked it to be static, as the commit log explains. - at the very heart of the logging subsystem and should rather be lean. - When looking at the callers, it is clear that it's correct. Yet I did think about it quite a bit: we actually do have negative categories, the DL* ones. so i did ask myself, should it convert from one to the other? But: It is called only in places where the idx is already checked, and the local variable at all the callers is an int... So maybe in future it should be able to convert a negative category? Considering these back and forth I ended up at "good enough compromise, not important enough to bother"... But your remark makes me reconsider, I guess it should be less public? https://gerrit.osmocom.org/c/libosmocore/+/36545/comment/eb8fbfce_23f8762d PS1, Line 434: const char *name = log_info->cat[cat_idx].name; > add `OSMO_ASSERT(cat_idx < log_info->num_cat)`? (as above) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36545?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5f81343e8c7b714a4630e64ba654e391435c4244 Gerrit-Change-Number: 36545 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanits...@sysmocom.de> Gerrit-CC: pespin <pes...@sysmocom.de> Gerrit-Attention: fixeria <vyanits...@sysmocom.de> Gerrit-Comment-Date: Wed, 10 Apr 2024 02:44:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanits...@sysmocom.de> Gerrit-MessageType: comment