{debuglog:text:till}

Description

Writes a message to the AA log as an entry of type DEBUG - but only until the time given in the second parameter - and always returns an empty string. The entry holds the text together with the current user, module, address and request URI, so you can see when and where a template was rendered and what a value was. Use it while debugging a template: give it an absolute date a few days ahead, such as 2026-11-20, in any form PHP strtotime reads, and it stops logging by itself once that time passes. Without a time, with a time already past, or with one that cannot be read, it logs nothing. Do not use a relative time like +3 days or tomorrow: it is computed anew on every render, so it never passes. The text is expanded first, so it may contain field values or other commands. The command is never cached - while the time has not passed, every render writes a new entry, visits of bots included. Find the entries in the AA log under event type DEBUG; State Check (Find forgotten debuglog expressions) lists every template that still contains the command.

Parameters

text optional default (empty)

The message to log. It is expanded before logging, so it may hold field values or other commands. Write an alias in braces - a bare alias reaches the command as its name, because aliases are replaced only in the finished output. Stored as the text of the DEBUG entry; empty is allowed.

till optional default (empty - nothing is logged)

The last moment to log - a date or time in any form PHP strtotime reads, such as 2026-11-20 or 2026-11-20 18:00. Use an absolute date: a relative one such as +3 days or tomorrow is computed anew on each render and so never passes. A date alone means midnight at its start: 2026-11-20 logs until the end of 2026-11-19 - add a time, such as 2026-11-20 23:59, to include that day. Empty, unreadable or already past: nothing is logged.

Examples

test[{debuglog:item import finished}]
Expected[]
Actual[]
The command returns an empty string, so nothing appears on the page - the brackets show it. Without the second parameter nothing is written to the log either; give it the time until which to log.
testbefore{debuglog:reached step 2}after
Expectedbeforeafter
Actualbeforeafter
Placed inline, the call leaves no gap and no marker - before and after sit next to each other. Use it to record that a branch of a template was reached without disturbing the output.
test[{debuglog:import finished:2020-01-01}]
Expected[]
Actual[]
Once the time in the second parameter has passed nothing is logged - this is what a call left in a template does after its date. Any form PHP strtotime reads works: 2020-01-01, 2020-01-01 18:00 and so on.
test[{debuglog:user count is {count:1-2-3}:2020-01-01}]
Expected[]
Actual[]
The text is expanded first: while the time had not passed, the logged text was user count is 3. The time here is long past, so this render logs nothing, and the inline output is empty either way.
virtual{debuglog:filter gives {_#FILTERED}:2026-09-15}
Expected(nothing on the page; until 2026-09-15 each render wrote one DEBUG entry with the text, after it nothing)
Illustrative: put the call where the value is known and give it an absolute date a few days ahead. Write an alias in braces, as here - a bare alias would be logged as its name. The date here has passed, so the example logs nothing now. Remove the call once the debugging is over.
test[{debuglog}]
Expected[]
Actual[]
With neither text nor time nothing is logged and the result is empty.