Cisco Interview Question

How to efficiently implement log function using C?