Rename sf_dbg -> sf_log. Also use fputs to print lines to stream.