YouCube icon indicating copy to clipboard operation
YouCube copied to clipboard

Print to debugger peripheral (on craftos)

Open Commandcracker opened this issue 3 years ago • 0 comments

Describe the feature.

debugger-peripheral

code snippets:

local debugger = peripheral.find("debugger")
function debug(...)
    if args.verbose then
        print(...)
    end
    if debugger then
        debugger.print(...)
    end
end
if periphemu then
    periphemu.create("right", "debugger")
end

local debugger = peripheral.find("debugger")
function debug_print(...)
    if debugger then
        debugger.print("[" .. os.date("%H:%M:%S") .. "] " .. table.concat({ ... }, " "))
    else
        print(...)
    end
end
if periphemu then
    periphemu.create("top", "speaker")
    -- Fuck the max websocket message police
    config.set("http_max_websocket_message", 2 ^ 30)
    -- create debugger
    if args.verbose then
        periphemu.create("right", "debugger")
    end
end

local debugger = peripheral.find("debugger")
function debug(...)
    if args.verbose then
        libs.youcubeapi.debug_print(...)
    end
end

Commandcracker avatar Dec 24 '22 10:12 Commandcracker