Fix a logging bug for dynamic lib loading exception