refac of appendToLocalLog