Log In  

Cart #lens-3 | 2024-04-23 | Embed ▽ | License: CC4-BY-NC-SA
5

Lens 0.1.2

Capture and view debugging information. This app will run and allow you to send it values to log and inspect. Since this runs as a separate process, you can still inspect log values even in the event of your program crashing.

Supports all data types and includes the ability to inspect table values.

Usage

To use, include "libs/lens.lua" from the cart, and call Lens.log().

Otherwise just send a "log" event to the lens process:

send_message(lens_pid, {
    event = "log",
    value = "log output",
})

This is an early release to collect feedback, so please let me know if you find it useful or any issues you encounter.

P#147194 2024-04-23 14:46 ( Edited 2024-04-23 22:21)

Hey, this looks so cool!
Unfortunately it's crashing for me:

This works:
include("libs/lens.lua")
Lens.log("test")

But when I hit escape to go back to the desktop (to see Lens), I get this error:
.../lens.p64.png/main.lua:339: attempt to concatenate a nil value (field 'line')

The same happens with a windowed app
But this doesn't happen if I use send_message instead

EDIT: I redownloaded it and now it's working! Awesome work :D

P#147201 2024-04-23 17:47 ( Edited 2024-04-23 22:25)

Oh bless you. I haven't tried it yet, but just knowing someone is even working on something like this is cause for joy.

I'll check it out and get back to you with any feedback tonight.

Thanks in advance for your work!

EDIT: I couldn't wait til tonight ... I had to go try it out ... and it WORKS! Yeah!! Sweet! Nicely done.

P#147212 2024-04-23 21:43 ( Edited 2024-04-23 21:50)
1

> But when I hit escape to go back to the desktop (to see Lens), I get this error:
.../lens.p64.png/main.lua:339: attempt to concatenate a nil value (field 'line')

Ok I've guarded against this in 0.1.2. I can't reproduce currently but it shouldn't crash.

This is to do with the trace that the client generates from debug.traceback(). You can provide your own traceback as well:

send_message(lens_pid, {
    event = "log",
    value = "log output",
    trace = {{line=99, file="myfile.lua"}}
})
P#147215 2024-04-23 22:23

[Please log in to post a comment]