Rename folders appendig a child filename

I have a bunch of folders I want to rename by appendig to their names the name of a file inside them.
e.g.: I have a simple structure

Folder1
file1.log
file2.xxx
file3.xxx

Folder2
file1.log
file2.xxx
file3.xxx

and so on.

I wish to filter all the *.log files in flat view, click a button and end up with

Folder1 - file1
file1.log
file2.xxx
file3.xxx

Folder2 - file1
file1.log
file2.xxx
file3.xxx

Is there a way to accomplish this?
Tx

With the log files selected, a button which runs this should do what you want:

@nofilenamequoting Rename "{filepath$|..|noterm}" TO "{filepath$|..|noterm} - {file$|noext}"

It works!
As always your support is awesome. You save me a lot of work. Thank you.