← All posts

API & helpers

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:

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

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

See also

Install JustZix — and log without opening DevTools.

Rate this post

No ratings yet — be the first.

Try it yourself

Install JustZix and paste any snippet from this article. Two minutes from zero to a working rule across all your devices.

Get JustZix

Features · How it works · Examples · Use cases