modify log class to thread safe