Skip to content

Receiving logs into console even with nothing set to Logger #126

@comatory

Description

@comatory

I do a detection based on application environment to turn off logging completely like this:

_logger = Logger(output: null);
Logger.level = Level.nothing;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions