implement libc interfaces for printf, and update logs