It’s what you just did. Show the whole content of the console output, including the command used until the end.
In this case is simple, also a screenshot works, because there are few lines.
Otherwise you can copy/paste it to a plain txt file (select all, copy; create a blank txt file and paste)
A quicker & smarter approach would be:
sudo dnf whatever_command 2>&1 | tee konsole-your_filename_here.log
Typical recommended command example:
sudo dnf distro-sync --refresh --allowerasing 2>&1 | tee dsync-log.txt
which you can find here