The desktop app behind Notifio has an activity log: a black monospace box that prints what the monitor is doing. Important lines are green. That is nine lines of component:
const HIGHLIGHT_RE = / new listing | sent | found / i ;
// ... < span className = { HIGHLIGHT_RE . test ( line ) ? "font-semibold text-[#4ade80]" : "text-[#a3a3a3]" } > { line } </ span >
Enter fullscreen mode
Exit fullscreen mode
Three alternatives, one colour, no state. I went to add a fourth alternative and checked what the existing three actually catch first.
The log has exactly one author
This part makes the audit tractable. Every line in that box comes from one function in one module:
function log ( msg : string ) : void { const line = `[${new Date().toLocaleTimeString()}] ${msg}` ; console . log ( line ) ; _logListeners .…