amicli.c: Guard debug events based on debug level#11
amicli.c: Guard debug events based on debug level#11InterLinked1 merged 1 commit intoInterLinked1:masterfrom
Conversation
Allan-N
commented
Sep 11, 2025
- Allow one to control the debug levels before creating a session
- Update what logs are generated based on the debug level (start off quiet with more info as the debug level is increased)
InterLinked1
left a comment
There was a problem hiding this comment.
I'm not sure I understand why the library itself (libcami) needs to be altered to do this. Isn't the debug logic you want to modify within amicli.c? (This is not part of libcami, it's a standalone program).
I think I'd prefer just a global variable in amicli.c unless there's a good reason to update the library for this.
|
The cami library provides the ami_set_debug_level() API. I added the matching ami_debug_level() API to retrieve the previously set value. As far as amicli, one could use a global but some folks avoid going down that path, especially for more involved projects with multiple source files. I just opted to use the new ami_debug_level() API to retrieve the current value. |
That's to set the debug library of libcami, not of the program using libcami.
I think you're conflating two different things here - amicli.c is a separate thing that is not part of the CAMI library, just like simpleami.c. They are both just example programs that are in the tree for convenience. I don't think tying the library debug level to the program debug level is necessarily appropriate. I'd be okay with this change since it doesn't really do any harm, but I don't think it's the way that I intended consumers to interface with the library. Only request is please update the commit message to |
- Allow one to control the debug levels before creating a session - Update what logs are generated based on the debug level (start off quiet with more info as the debug level is increased)
8962fc6 to
cced70b
Compare
Fair enough. I changed amicli.c to use a global ... but I'm still using the same
Updated |