Modified API. Now properly prints log level