mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
### What does this PR do? Add MySQL support, Refactor will be in a followup PR ### How did you verify your code works? A lot of tests --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cirospaciari <6379399+cirospaciari@users.noreply.github.com>
27 lines
906 B
Zig
27 lines
906 B
Zig
pub fn write(data: []const u8) void {
|
|
debug("SocketMonitor: write {s}", .{std.fmt.fmtSliceHexLower(data)});
|
|
if (comptime bun.Environment.isDebug) {
|
|
DebugSocketMonitorWriter.check.call();
|
|
if (DebugSocketMonitorWriter.enabled) {
|
|
DebugSocketMonitorWriter.write(data);
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn read(data: []const u8) void {
|
|
debug("SocketMonitor: read {s}", .{std.fmt.fmtSliceHexLower(data)});
|
|
if (comptime bun.Environment.isDebug) {
|
|
DebugSocketMonitorReader.check.call();
|
|
if (DebugSocketMonitorReader.enabled) {
|
|
DebugSocketMonitorReader.write(data);
|
|
}
|
|
}
|
|
}
|
|
|
|
const debug = bun.Output.scoped(.SocketMonitor, .visible);
|
|
|
|
const DebugSocketMonitorReader = @import("./DebugSocketMonitorReader.zig");
|
|
const DebugSocketMonitorWriter = @import("./DebugSocketMonitorWriter.zig");
|
|
const bun = @import("bun");
|
|
const std = @import("std");
|