Hi, find answers in place.
On 26/07/18 16:20, Neels Hofmeyr wrote:
No, we cannot, we would probably require a new API to store them as "harcoded categories"
The information is always there, the default categories log_info_cat struct are const. Remeber, each log target has its own category-level settings, so obviously the hardcoded defaults remain available. It's a simple thing.
Ok, no need for new API, since it's already done using a specific API (log_init). But we'd need to change the implementation to account in that function that for each category the value being copied is the "hardcoded default" instead of a regular level being set.
And same as my last comment, you are changing a decade old vty command. Last time I did this it was the wrong choice.
Ok so let's leave it broken and useless then? Deprecate it and write an entire new system? No, thanks.
Someone can always add these feature on top of present patchset if there's enough use for it.
Introducing a common default level actually also closes the door on fine-grained default levels. I mean the VTY UI you are introducing would have to be deprecated to introduce fine-grained defaults.
What do you mean with fine-grained default levels? Having a way to go back to hardcoded initial values? You can have that as long as you store the values in log_init in a new var default_loglevel for each category.
If you still want more temporary levels (increase/decrease or whatever you call it) per logtarget or even per category, you can add them later and check them before the other levels in should_log_to_target(), then change them with new VTY commands.
So the patch does what you want and is better than current 'logging level all xxx' indeed, but changes old UI and has limits. As much as I'd like to let it go ahead, I'm still -1, sorry.
It's compatible with old UI. All programs using the API continue to work fine as well as old cfg files. It adds new parameter "logging level default <loglevel>" and "logging level <category> unset", that's all. So it fixes broken logging level all and adds extra feature to make it useful.
1- Open a new VTY, then call logging level all debug
true. Any opinions on this one, Keith maybe?
You can even just re-open the session you have opened, no need to open a second one.