adapt upstream and fix log level replacement