Abstract out method that works out if a message should be logged to use in tests
Added getter for the current set of levels on a logger