add common source for log and socket wrap