You mean you want to make a screen recording of Logic playing?
First you need to install Soundflower.
https://rogueamoeba.com/freebies/soundflower/
Then you need to select Soundflower (2 ch) as the output device in Logic.
Then you need to open Quicktime Player
Select "New Screen Recording"
Select Soundflower as the input device for Quicktime.
Start recording in Quicktime by clicking the red "bullseye" button shown in the pic above. You'll see this. Read carefully. Do what it says.
So, you've clicked on the screen, recording has started. Now switch to Logic (by clicking on any of its windows, or by clicking its icon in the dock) and start playback. When Logic has reached the end of the project, stop the recording by clicking the Quicktime button in the menubar.
The Quicktime movie will now appear on your screen. You have to name and save it, and now you have the movie with the sound from Logic.
The movie will look deceptively like "the real thing" (see the "doubling" of the dock in the pic above), you can see it is not the real thing because of the movie playback controls.
If you do not want the dock in the movie, you can hide it by hitting option-cmd-D. You could also put Logic fullscreen before recording.