Output Console as a production logger — window.JUSTZIX in practice
Diagnosing a page with console.log needs DevTools open — and that takes half the screen and vanishes on every reload. window.JUSTZIX logs into the Output Console window, which is part of the page: it stays where you put it, and you see it without F12.
Two different APIs
JustZix gives rule code two global objects — easy to confuse:
window.JZ— drives actions (JZ.clickand friends).window.JUSTZIX— a logger. Writes entries to the Output Console window.
This article is about the second one.
The logger methods
JUSTZIX.log('a plain entry');
JUSTZIX.info('information');
JUSTZIX.warn('a warning');
JUSTZIX.error('an error');
JUSTZIX.debug('a diagnostic detail');
Each level has its own color in the Output Console and can be filtered. There are also aliases __JUSTZIX__ and JZ.log/.warn/... — in case the page has its own variable named JUSTZIX.
Why not plain console.log
- No DevTools. The Output Console renders on the page. You do not have to open F12 or keep it open.
- It survives in view. A pinned Output window stays in the corner of the tab — you see logs out of the corner of your eye, all the time.
- Filters and search. You filter levels and search entries — built into the window.
The Output Console also captures the page's own console.log and uncaught errors — but JUSTZIX.* is your own channel, visually separated from the page's noise.
Pattern — checkpoints in a rule
JUSTZIX.info('Cart rule — start');
const items = document.querySelectorAll('.cart-item');
JUSTZIX.log('Items in cart: ' + items.length);
if (!items.length) JUSTZIX.warn('Empty cart — selector still current?');
The rule narrates what it does. When it stops working, the Output Console shows exactly which step — with no guessing.
Pitfalls
- Logs in a loop. A
JUSTZIX.login ascrollhandler or aMutationObserverfloods the window. Log events, not every frame. - The debug level can be hidden. The Output Console filters
debugby default — if you do not see an entry, check the level filter.
See also
- Output Console — the full window write-up
- Output Console catches errors — what else lands in the window
- Rules resilient to DOM changes — the logger as an early-warning system
Install JustZix — and log without opening DevTools.
Rate this post
No ratings yet — be the first.