write to log file (draft)
ref