simple log implementation in c