log function abstraction