Removed c-style cast
added function to set logging level