properly handle case where file/function in log is nil