change log function to lib