Hello, xrDebug

Lightweight remote PHP debugger.

rodber
rodber Β  GitHub

I've made a PHP debugger, give it a try at xrdebug/xrdebug.

xrDebug light

To end 2021 I gave myself a few days to create a different piece of software and I ended up building a lightweight PHP debugger, which is a type of software used for developers to retrieve dump information about things happening in a software system.

πŸ¦„ I spawned this software in less than one week. I did this for the fun of creating something, and for the sake of a distraction-free lightweight debug experience.

# Introducing xrDebug

xrDebug is a debugger where dump messages, emitted from your code gets streamed to a debug server.

xrDebug is a software that started to grow on me the first time I saw Spatie's Ray. I noticed that the Ray debug approach could suit me and my clients. But I wanted a different user interface and portability of the debug sessions.

It is named xrDebug for "X-Ray", as X less Ray. xrDebug is a different debugger with other features, flavours and culture.

# xrDebug origins

For Chevere, I built a VarDump replacement with support for console, plain and HTML document generation. I made it to help customers/developers when needing to debug my software. It generates multiple document formats and it adapts to the need and context where the code is running to display consistent dump information.

The dump information is generated using reflection and variable analyzers. The documents generated with VarDump provide explicit information about visibility, size and length of all members.

xdd

πŸ’‘ Chevere VarDump provides vd() and vdd() which are Chevere's own version of dump() and dd().

Chevere VarDump works by writing dump strings per-line, it uses streams for that purpose which makes it memory efficient. The formatting is decoupled, enabling to use the same interface to generate customized documents, which is where I hooked xrDebug.

# Features

# πŸ’Ž Variable highlight

xrDebug uses Chevere VarDump to display good looking, consistent, not-stricly-dev-readable information. Useful for both experienced developers and newbies.

# ✨ Dump variables

You can dump single or multiple arguments and use named arguments for increased context.

xr('Hello, world!);
xr($var1, $var2, ..., $varN+1);
xr(one: $var1, cloned: $var2);

# 🐘 One-click server

xrDebug server runs on top of ReactPHP, no extra dependencies required. It will run in any compatible PHP system!

# πŸ‘» Filtering

Filter messages by topics and/or emotes as xrDebug doesn't restrict you to log levels, colors, events or anything. You build the context which each message delivered.

# ✍️ Rename "xrDebug"

Make it yours, customize the title to suit your needs.

# 🏁 Session controls

Resume, pause, stop and clear the debug session anytime.

# πŸ₯· Keyboard shortcuts

Resume R, Pause P, Stop S and Clear C.

# πŸ“Ÿ Backtrace

Understand the call stack related to any section of your code and only when you need it.

# 🌚🌝 Dark/Light modes

xrDebug comes with a theme which follows your system preferences with automatic dark/light mode switch.

# πŸ‘½ Ephemeral

And it's gone! xrDebug doesn't require to store any persistent data. No database required.

# πŸ’ HTML based

xrDebug user interface is HTML. You can benefit from all the goodies including customization, save your session for offline usage, add as shortcut app, etc.

# πŸ”₯ Beautiful looking dumps β„’

It uses FiraCode font for displaying dumps with ligatures, symbols and more.

# πŸ˜… Throwable handler

Handle exceptions/errors by hook or replace your existing handler.

# xrDebug Tiempos

Now that xrDebug is available everybody go to trace yourselves The Plague way.

Rodolfo blogging since 2012.