Reworked logging mechanism, added duc_set_log_callback() and duc_set_log_level()