Multi-line logs get mixed up?

I’m not sure when this started happening, but all of my multi-line debug logs are showing up out of order now. For example, I expect the output to look like this:

Zone Downstairs - Motion Sensor
Guest Bedroom Motion Sensor is inactive 
Inactive Event
engaged = Guest Bedroom Presence Sensor is present
entry = closed
occupancy = occupied
 => ignored (engaged)

But instead, I’m seeing this:

The message itself is built up over several lines, across different methods, but it basically looks like this:

def debugContext = """Zone ${app.label} - Motion Sensor
${evt.device} is ${evt.value}"""

debugContext = """$debugContext
Inactive Event
engaged = ${zoneIsEngaged()}
entry = ${zone.currentValue('entry')}
occupancy = ${zone.currentValue('occupancy')}

log.debug "$debugContext => ignored (engaged)"

I swear this wasn’t happening a few days ago, but now every log from this application is getting jumbled like this. I thought maybe it had to do with the substitution of $debugContext, but even the lines for engaged, entry, and occupancy are reversed.

Did something change recently with the platform that may have caused this? Or could I be doing something incorrectly that I didn’t notice until now?

I noticed this in the recent release notes, but I’m not sure if it’s related:

  • Longer log history, displayed 500 lines initially with more available on demand.

After more digging, it looks like they’re showing up correctly on the Current Logs page, but incorrectly on the Past Logs page:

Might be something @gopher.ny has insight into?

1 Like

The rendering part hasn't changed... every log entry makes a div, and changes were about controlling how many of those divs are created instead of trying to do everything. I'll check it out.

1 Like

Check it in (just released).

1 Like

Looks perfect; thank you for the fix!!!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.