log function for elements