Both the GUI and the core have loggers. It should be possible to manipulate them from the GUI.
Adding these to the preference menu is not hard. What core APIs should the gui call to manipulate the logging level?