I want to print the log level of our Rails web app. I get the log level as an integer when I run Rails.logger.level
My question - is there a built-in method to get the log level as a String("DEBUG","INFO" etc)
I can write a code to translate manually( if level == 0 puts "DEBUG") but it seems to me not to be a clean code solution
Rails Logger is just a fancy ruby Logger
Knowing this you could use:
but the real question is why?
There are more readable and idiomatic alternatives for your suggested code e.g.