Made Log class thread-safe.