The text size is dictated by UIErrorsFrame itself, I don't think you can change the size of an individual line.
As for the icon, I don't think you can dynamically get the file path to use in the texture escape sequence if you were looking to code for any spell, but you can look up the file name on wowhead by finding the icon ID.
Now for the class color, you'll have to query UnitGUID("target"), then the second return of GetPlayerInfoByGUID(guid), then RAID_CLASS_COLORS[class].colorStr.
Code:
local guid,_,class,color=UnitGUID("target")
if guid then
_,class=GetPlayerInfoByGUID(guid)
end
if class then
color=RAID_CLASS_COLORS[class].colorStr
end
Now put everything together:
Lua Code:
local guid,name,_,class,color=UnitGUID("target"),UnitName("target")
if guid then
_,class=GetPlayerInfoByGUID(guid)
end
if class then
color=RAID_CLASS_COLORS[class].colorStr
end
UIErrorsFrame:AddMessage("Casted \124TInterface\\ICONS\\Spell_nature_earthbind:0\124t on "..((color and "\124C"..color or "")..(name or "")..(color and "\124r" or "")).."!!",1.0,2.0,1.0,53,3)