Improved log feature

Introduced proper logging functions (log_info and log_error).