How to get the current log level?

Now that we have template select with 2021.9 series of HA,
I would like to convert my logger input_select described here to template select and remove the automation.

It was a pretty good idea, thanks to VDRainer.
But how can I get the current log level for “state”? Any ideas?

I was looking for a python script or anyway to get the current log level for the core or other components but still couldn’t find any way.