Styling Debug Log Entries

When working on enforcing style rules, I stumbled on an interesting feature. I tried printing out the regex rule used in a replacement, such as: '/Pearson[\'‘’]+s\s*Hall/u'. However, in the debug log, the brackets were missing and the various apostrophes shown in bold.

It appears that we can use brackets to bold text in the debug log display. My guess is that this is in place to style the date at the start of each entry, but we can also put it to use.

For instance, I was able to do the following:

$_LW->logDebug(
	'[(Style Checker: Enabled)] '.
	'[Field]: "'.$field_name.'" '.
	'[Regex]: "'.str_replace(['[',']'], ['[',']'], $regex).'" '.
	'[After]: "'.mb_substr(strip_tags($_LW->save_data[$field_name]), 0, 1000).'"' // changed
);

To get something like this:

28-Feb-2025 12:00:00pm CST /livewhale/?profiles_edit&id=8115&tid=72 LiveWhale Debug: (Style Checker: Enabled) Field: “custom_333” Regex: “/Pearson['‘’´`]+s\s*Hall/u” After: “K. Slider ’25 enjoys going to Pearsons Hall.” (etc)

Maybe this will help others make their debug output more readable.