change printf to syslog