Help make script much easier

Is there any method to realise this in one command?
Thanks in advance

Do away with the ls call.

for file in *.log ;do line="$file:$line" ;done

I would like to know what this script is doing.