Integraciones
Ejemplos de integración
Envía logs a DebuggerOnline por HTTP POST o por UDP
(host debuggeronline.com, puerto 9999). Encapsula el envío en una
función reutilizable para poder cambiar de método sin tocar todo el código.
Repositorio: github.com/DebuggerOnline
Python — HTTP
import requests
requests.post("https://debuggeronline.com/write", json={
"channel": "YOUR_CHANNEL_ID",
"message": "Hello from Python",
}, headers={"X-API-Key": "YOUR_KEY"})
Python — UDP
import socket, json
msg = json.dumps({"channel": "YOUR_CHANNEL_ID", "message": "Hello via UDP"})
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(msg.encode(), ("debuggeronline.com", 9999))
Node.js — HTTP
await fetch("https://debuggeronline.com/write", {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-Key": "YOUR_KEY" },
body: JSON.stringify({ channel: "YOUR_CHANNEL_ID", message: "Hello from Node" }),
});
Node.js — UDP
const dgram = require("dgram");
const msg = Buffer.from(JSON.stringify({
channel: "YOUR_CHANNEL_ID", message: "Hello via UDP",
}));
dgram.createSocket("udp4").send(msg, 9999, "debuggeronline.com");
Java — HTTP
var json = "{\"channel\":\"YOUR_CHANNEL_ID\",\"message\":\"Hello from Java\"}";
var conn = (HttpURLConnection) new URL("https://debuggeronline.com/write").openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("X-API-Key", "YOUR_KEY");
conn.setDoOutput(true);
conn.getOutputStream().write(json.getBytes());
conn.getResponseCode();
Android (Kotlin) — UDP
val msg = "{\"channel\":\"YOUR_CHANNEL_ID\",\"message\":\"Hello via UDP\"}"
val addr = InetAddress.getByName("debuggeronline.com")
val packet = DatagramPacket(msg.toByteArray(), msg.length, addr, 9999)
DatagramSocket().send(packet)
iOS (Swift) — HTTP
var req = URLRequest(url: URL(string: "https://debuggeronline.com/write")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.setValue("YOUR_KEY", forHTTPHeaderField: "X-API-Key")
req.httpBody = try? JSONSerialization.data(withJSONObject: [
"channel": "YOUR_CHANNEL_ID", "message": "Hello from Swift",
])
URLSession.shared.dataTask(with: req).resume()
Django — logging handler
import logging, requests
class DebuggerOnlineHandler(logging.Handler):
def emit(self, record):
requests.post("https://debuggeronline.com/write", json={
"channel": "YOUR_CHANNEL_ID",
"message": self.format(record),
}, headers={"X-API-Key": "YOUR_KEY"}, timeout=2)
logging.getLogger("django").addHandler(DebuggerOnlineHandler())
Shell — curl / nc
curl -X POST https://debuggeronline.com/write \
-H "X-API-Key: YOUR_KEY" \
-d '{"channel":"YOUR_CHANNEL_ID","message":"hi"}'
echo -n '{"channel":"YOUR_CHANNEL_ID","message":"hi"}' | nc -u -w1 debuggeronline.com 9999