Hi Vince,
This is actually possible. In the event handler, you can check the current attributes and only override them if they have default values. The default value for font color is
clWindowText, background color -
clWindow, font style - 0 (normal). This way, log entries posted without the attributes parameter will be styled as specified by the event handler, and those with custom attributes will have these "forced" attributes. Here's an example:
Sub GeneralEvents_OnLogEvent(Sender, LogParams)
With LogParams
If .FontColor = clWindowText Then .FontColor = clGray
If .Color = clWindow Then .Color = clCream
If .FontStyle = 0 Then .FontStyle = 2 ' italic
End With
End Sub
Sub Test
Log.Event "Gray italic text on a cream background"
Set attrBlock = Log.CreateNewAttributes
attrBlock.Bold = true
attrBlock.FontColor = vbWhite
attrBlock.BackColor = Builtin.clNavy
Log.Event "White bold text on a blue background", "", , attrBlock
End Sub