The colorizeLogEntries hook is triggered when a log entry is displayed. It passes
the data of the log entry and the label created by Contao and does expect
a string for the label as return value.
Parameters
string$row
The data of the log entry record.
string$label
The label as created by Contao. If not modified by this hook, this
is what will be displayed.
Return Values
Return the processed $label string.
Example
// src/EventListener/ColorizeLogEntriesListener.php
namespaceApp\EventListener;useContao\CoreBundle\DependencyInjection\Attribute\AsHook;#[AsHook('colorizeLogEntries')]
classColorizeLogEntriesListener{publicfunction__invoke(array$row,string$label):string{// Wrap the label with a span containing a custom CSS class or style attributes
if(…){$label=preg_replace('@^(.*</span> )(.*)$@U','$1 <span class="tl_purple">$2</span>',$label);}return$label;}}