use log_* functions instead of err*/warn*
fix format for time_t