Meaning I still create Logger instance so I don't have to put if (env == 'prod') everywhere in my app. I just tried running it locally where I've overriden env detection so the code above is executed however I still see logs flowing into my system console.
Did I somehow misunderstood what Logger.level does? I'm using _logger.d(), _logger.i etc so the levels for each message are set appropriately. I would assume since Level.nothing has value of 6 it's higher that the other ones and it all should be ignored.
I do a detection based on application environment to turn off logging completely like this:
Meaning I still create
Logger
instance so I don't have to putif (env == 'prod')
everywhere in my app. I just tried running it locally where I've overriden env detection so the code above is executed however I still see logs flowing into my system console.Did I somehow misunderstood what
Logger.level
does? I'm using_logger.d()
,_logger.i
etc so the levels for each message are set appropriately. I would assume sinceLevel.nothing
has value of6
it's higher that the other ones and it all should be ignored.