Support custom log function