diff --git a/src/HTMLScanner.zig b/src/HTMLScanner.zig index 32643e84ae..461e3ebbff 100644 --- a/src/HTMLScanner.zig +++ b/src/HTMLScanner.zig @@ -47,7 +47,7 @@ fn createImportRecord(this: *HTMLScanner, input_path: []const u8, kind: ImportKi try this.import_records.push(this.allocator, record); } -const debug = bun.Output.scoped(.HTMLScanner, true); +const debug = bun.Output.scoped(.HTMLScanner, .hidden); pub fn onWriteHTML(_: *HTMLScanner, bytes: []const u8) void { _ = bytes; // bytes are not written in scan phase diff --git a/src/Watcher.zig b/src/Watcher.zig index 082a4fe115..6ee87623af 100644 --- a/src/Watcher.zig +++ b/src/Watcher.zig @@ -2,7 +2,7 @@ const Watcher = @This(); -const DebugLogScope = bun.Output.Scoped(.watcher, false); +const DebugLogScope = bun.Output.Scoped(.watcher, .visible); const log = DebugLogScope.log; // This will always be [max_count]WatchEvent, diff --git a/src/allocators/MemoryReportingAllocator.zig b/src/allocators/MemoryReportingAllocator.zig index 97a4d68e62..4859adc26e 100644 --- a/src/allocators/MemoryReportingAllocator.zig +++ b/src/allocators/MemoryReportingAllocator.zig @@ -1,6 +1,6 @@ const MemoryReportingAllocator = @This(); -const log = bun.Output.scoped(.MEM, false); +const log = bun.Output.scoped(.MEM, .visible); child_allocator: std.mem.Allocator, memory_cost: std.atomic.Value(usize) = std.atomic.Value(usize).init(0), diff --git a/src/allocators/MimallocArena.zig b/src/allocators/MimallocArena.zig index 181933da2f..6a733311f9 100644 --- a/src/allocators/MimallocArena.zig +++ b/src/allocators/MimallocArena.zig @@ -2,7 +2,7 @@ const Self = @This(); heap: *mimalloc.Heap, -const log = bun.Output.scoped(.mimalloc, true); +const log = bun.Output.scoped(.mimalloc, .hidden); /// Internally, mimalloc calls mi_heap_get_default() /// to get the default heap. diff --git a/src/allocators/basic.zig b/src/allocators/basic.zig index 916d1871e4..f8c3c6b8b5 100644 --- a/src/allocators/basic.zig +++ b/src/allocators/basic.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.mimalloc, true); +const log = bun.Output.scoped(.mimalloc, .hidden); fn mimalloc_free( _: *anyopaque, diff --git a/src/ast/NewStore.zig b/src/ast/NewStore.zig index acea283dce..60aeb71f06 100644 --- a/src/ast/NewStore.zig +++ b/src/ast/NewStore.zig @@ -22,7 +22,7 @@ pub fn NewStore(comptime types: []const type, comptime count: usize) type { const backing_allocator = bun.default_allocator; - const log = Output.scoped(.Store, true); + const log = Output.scoped(.Store, .hidden); return struct { const Store = @This(); diff --git a/src/async/posix_event_loop.zig b/src/async/posix_event_loop.zig index de267944c1..b503feac19 100644 --- a/src/async/posix_event_loop.zig +++ b/src/async/posix_event_loop.zig @@ -5,7 +5,7 @@ pub const Loop = uws.Loop; pub const KeepAlive = struct { status: Status = .inactive, - const log = Output.scoped(.KeepAlive, false); + const log = Output.scoped(.KeepAlive, .visible); const Status = enum { active, inactive, done }; @@ -541,7 +541,7 @@ pub const FilePoll = struct { pending_free_head: ?*FilePoll = null, pending_free_tail: ?*FilePoll = null, - const log = Output.scoped(.FilePoll, false); + const log = Output.scoped(.FilePoll, .visible); pub fn init() Store { return .{ diff --git a/src/async/windows_event_loop.zig b/src/async/windows_event_loop.zig index 537a10b577..897166810e 100644 --- a/src/async/windows_event_loop.zig +++ b/src/async/windows_event_loop.zig @@ -3,7 +3,7 @@ pub const Loop = uv.Loop; pub const KeepAlive = struct { status: Status = .inactive, - const log = Output.scoped(.KeepAlive, false); + const log = Output.scoped(.KeepAlive, .visible); const Status = enum { active, inactive, done }; @@ -121,7 +121,7 @@ pub const FilePoll = struct { pub const Flags = Posix.FilePoll.Flags; pub const Owner = Posix.FilePoll.Owner; - const log = Output.scoped(.FilePoll, false); + const log = Output.scoped(.FilePoll, .visible); pub inline fn isActive(this: *const FilePoll) bool { return this.flags.contains(.has_incremented_poll_count); @@ -305,7 +305,7 @@ pub const FilePoll = struct { pending_free_head: ?*FilePoll = null, pending_free_tail: ?*FilePoll = null, - const log = Output.scoped(.FilePoll, false); + const log = Output.scoped(.FilePoll, .visible); pub fn init() Store { return .{ diff --git a/src/bake/DevServer.zig b/src/bake/DevServer.zig index 32e137c56c..316050d5b1 100644 --- a/src/bake/DevServer.zig +++ b/src/bake/DevServer.zig @@ -10,9 +10,9 @@ const DevServer = @This(); -pub const debug = bun.Output.Scoped(.DevServer, false); -pub const igLog = bun.Output.scoped(.IncrementalGraph, false); -pub const mapLog = bun.Output.scoped(.SourceMapStore, false); +pub const debug = bun.Output.Scoped(.DevServer, .visible); +pub const igLog = bun.Output.scoped(.IncrementalGraph, .visible); +pub const mapLog = bun.Output.scoped(.SourceMapStore, .visible); pub const Options = struct { /// Arena must live until DevServer.deinit() diff --git a/src/bake/DevServer/IncrementalGraph.zig b/src/bake/DevServer/IncrementalGraph.zig index 4389939589..0dc81d38cf 100644 --- a/src/bake/DevServer/IncrementalGraph.zig +++ b/src/bake/DevServer/IncrementalGraph.zig @@ -614,7 +614,7 @@ pub fn IncrementalGraph(side: bake.Side) type { bundle_graph_index: bun.ast.Index, temp_alloc: Allocator, ) bun.OOM!void { - const log = bun.Output.scoped(.processChunkDependencies, false); + const log = bun.Output.scoped(.processChunkDependencies, .visible); const file_index: FileIndex = ctx.getCachedIndex(side, bundle_graph_index).*.unwrap() orelse @panic("unresolved index"); // do not process for failed chunks log("index id={d} {}:", .{ @@ -715,7 +715,7 @@ pub fn IncrementalGraph(side: bake.Side) type { fn disconnectEdgeFromDependencyList(g: *@This(), edge_index: EdgeIndex) void { const edge = &g.edges.items[edge_index.get()]; const imported = edge.imported.get(); - const log = bun.Output.scoped(.disconnectEdgeFromDependencyList, true); + const log = bun.Output.scoped(.disconnectEdgeFromDependencyList, .hidden); log("detach edge={d} | id={d} {} -> id={d} {} (first_dep={d})", .{ edge_index.get(), edge.dependency.get(), @@ -804,7 +804,7 @@ pub fn IncrementalGraph(side: bake.Side) type { css, }, ) bun.OOM!enum { @"continue", stop } { - const log = bun.Output.scoped(.processEdgeAttachment, false); + const log = bun.Output.scoped(.processEdgeAttachment, .visible); // When an import record is duplicated, it gets marked unused. // This happens in `ConvertESMExportsForHmr.deduplicatedImport` @@ -923,7 +923,7 @@ pub fn IncrementalGraph(side: bake.Side) type { // don't call this function for CSS sources bun.assert(ctx.loaders[index.get()] != .css); - const log = bun.Output.scoped(.processChunkDependencies, false); + const log = bun.Output.scoped(.processChunkDependencies, .visible); for (ctx.import_records[index.get()].slice()) |import_record| { // When an import record is duplicated, it gets marked unused. // This happens in `ConvertESMExportsForHmr.deduplicatedImport` diff --git a/src/bake/production.zig b/src/bake/production.zig index fc630ad22c..022f692617 100644 --- a/src/bake/production.zig +++ b/src/bake/production.zig @@ -1,5 +1,5 @@ //! Implements building a Bake application to production -const log = bun.Output.scoped(.production, false); +const log = bun.Output.scoped(.production, .visible); pub fn buildCommand(ctx: bun.cli.Command.Context) !void { bun.bake.printWarning(); diff --git a/src/bun.js/Debugger.zig b/src/bun.js/Debugger.zig index 2e9cf19e63..2a634f6594 100644 --- a/src/bun.js/Debugger.zig +++ b/src/bun.js/Debugger.zig @@ -21,7 +21,7 @@ must_block_until_connected: bool = false, pub const Wait = enum { off, shortly, forever }; -pub const log = Output.scoped(.debugger, false); +pub const log = Output.scoped(.debugger, .visible); extern "c" fn Bun__createJSDebugger(*JSGlobalObject) u32; extern "c" fn Bun__ensureDebugger(u32, bool) void; @@ -289,7 +289,7 @@ pub fn willDispatchAsyncCall(globalObject: *JSGlobalObject, call: AsyncCallType, pub const TestReporterAgent = struct { handle: ?*Handle = null, - const debug = Output.scoped(.TestReporterAgent, false); + const debug = Output.scoped(.TestReporterAgent, .visible); pub const TestStatus = enum(u8) { pass, @@ -363,7 +363,7 @@ pub const TestReporterAgent = struct { pub const LifecycleAgent = struct { handle: ?*Handle = null, - const debug = Output.scoped(.LifecycleAgent, false); + const debug = Output.scoped(.LifecycleAgent, .visible); pub const Handle = opaque { extern "c" fn Bun__LifecycleAgentReportReload(agent: *Handle) void; diff --git a/src/bun.js/ModuleLoader.zig b/src/bun.js/ModuleLoader.zig index ce17b569cc..5a9cca2496 100644 --- a/src/bun.js/ModuleLoader.zig +++ b/src/bun.js/ModuleLoader.zig @@ -3059,7 +3059,7 @@ export fn ModuleLoader__isBuiltin(data: [*]const u8, len: usize) bool { return HardcodedModule.Alias.bun_aliases.get(str) != null; } -const debug = Output.scoped(.ModuleLoader, true); +const debug = Output.scoped(.ModuleLoader, .hidden); const string = []const u8; diff --git a/src/bun.js/ProcessAutoKiller.zig b/src/bun.js/ProcessAutoKiller.zig index 69e1434f52..be4e803ff0 100644 --- a/src/bun.js/ProcessAutoKiller.zig +++ b/src/bun.js/ProcessAutoKiller.zig @@ -1,6 +1,6 @@ const ProcessAutoKiller = @This(); -const log = bun.Output.scoped(.AutoKiller, true); +const log = bun.Output.scoped(.AutoKiller, .hidden); processes: std.AutoArrayHashMapUnmanaged(*bun.spawn.Process, void) = .{}, enabled: bool = false, diff --git a/src/bun.js/RuntimeTranspilerCache.zig b/src/bun.js/RuntimeTranspilerCache.zig index 989ad5fce6..a39006121f 100644 --- a/src/bun.js/RuntimeTranspilerCache.zig +++ b/src/bun.js/RuntimeTranspilerCache.zig @@ -14,7 +14,7 @@ /// Version 15: Updated global defines table list. const expected_version = 15; -const debug = Output.scoped(.cache, false); +const debug = Output.scoped(.cache, .visible); const MINIMUM_CACHE_SIZE = 50 * 1024; // When making parser changes, it gets extremely confusing. diff --git a/src/bun.js/api/BunObject.zig b/src/bun.js/api/BunObject.zig index 5cd037ee4d..8fee145369 100644 --- a/src/bun.js/api/BunObject.zig +++ b/src/bun.js/api/BunObject.zig @@ -962,7 +962,7 @@ export fn Bun__resolveSyncWithPaths( } export fn Bun__resolveSyncWithStrings(global: *JSGlobalObject, specifier: *bun.String, source: *bun.String, is_esm: bool) jsc.JSValue { - Output.scoped(.importMetaResolve, false)("source: {s}, specifier: {s}", .{ source.*, specifier.* }); + Output.scoped(.importMetaResolve, .visible)("source: {s}, specifier: {s}", .{ source.*, specifier.* }); return jsc.toJSHostCall(global, @src(), doResolveWithArgs, .{ global, specifier.*, source.*, is_esm, true, false }); } diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig index 86d9366066..f4505172b5 100644 --- a/src/bun.js/api/JSBundler.zig +++ b/src/bun.js/api/JSBundler.zig @@ -1,4 +1,4 @@ -const debug = bun.Output.scoped(.Transpiler, false); +const debug = bun.Output.scoped(.Transpiler, .visible); pub const JSBundler = struct { const OwnedString = bun.MutableString; @@ -682,7 +682,7 @@ pub const JSBundler = struct { /// Defer may only be called once called_defer: bool, - const debug_deferred = bun.Output.scoped(.BUNDLER_DEFERRED, true); + const debug_deferred = bun.Output.scoped(.BUNDLER_DEFERRED, .hidden); pub fn init(bv2: *bun.BundleV2, parse: *bun.bundle_v2.ParseTask) Load { return .{ diff --git a/src/bun.js/api/bun/dns.zig b/src/bun.js/api/bun/dns.zig index c3117f480d..3d68a3a26e 100644 --- a/src/bun.js/api/bun/dns.zig +++ b/src/bun.js/api/bun/dns.zig @@ -166,7 +166,7 @@ const LibC = struct { /// The windows implementation borrows the struct used for libc getaddrinfo const LibUVBackend = struct { - const log = Output.scoped(.LibUVBackend, false); + const log = Output.scoped(.LibUVBackend, .visible); fn onRawLibUVComplete(uv_info: *libuv.uv_getaddrinfo_t, _: c_int, _: ?*libuv.addrinfo) callconv(.C) void { //TODO: We schedule a task to run because otherwise the promise will not be solved, we need to investigate this @@ -267,7 +267,7 @@ pub fn ResolveInfoRequest(comptime cares_type: type, comptime type_name: []const return struct { const request_type = @This(); - const log = Output.scoped(.ResolveInfoRequest, true); + const log = Output.scoped(.ResolveInfoRequest, .hidden); resolver_for_caching: ?*Resolver = null, hash: u64 = 0, @@ -373,7 +373,7 @@ pub fn ResolveInfoRequest(comptime cares_type: type, comptime type_name: []const pub const GetHostByAddrInfoRequest = struct { const request_type = @This(); - const log = Output.scoped(@This(), false); + const log = Output.scoped(@This(), .visible); resolver_for_caching: ?*Resolver = null, hash: u64 = 0, @@ -472,7 +472,7 @@ pub const GetHostByAddrInfoRequest = struct { }; pub const CAresNameInfo = struct { - const log = Output.scoped(.CAresNameInfo, true); + const log = Output.scoped(.CAresNameInfo, .hidden); globalThis: *jsc.JSGlobalObject, promise: jsc.JSPromise.Strong, @@ -534,7 +534,7 @@ pub const CAresNameInfo = struct { pub const GetNameInfoRequest = struct { const request_type = @This(); - const log = Output.scoped(@This(), false); + const log = Output.scoped(@This(), .visible); resolver_for_caching: ?*Resolver = null, hash: u64 = 0, @@ -626,7 +626,7 @@ pub const GetNameInfoRequest = struct { }; pub const GetAddrInfoRequest = struct { - const log = Output.scoped(.GetAddrInfoRequest, false); + const log = Output.scoped(.GetAddrInfoRequest, .visible); backend: Backend = undefined, resolver_for_caching: ?*Resolver = null, @@ -882,7 +882,7 @@ pub const GetAddrInfoRequest = struct { }; pub const CAresReverse = struct { - const log = Output.scoped(.CAresReverse, false); + const log = Output.scoped(.CAresReverse, .visible); resolver: ?*Resolver, globalThis: *jsc.JSGlobalObject, @@ -955,7 +955,7 @@ pub const CAresReverse = struct { pub fn CAresLookup(comptime cares_type: type, comptime type_name: []const u8) type { return struct { - const log = Output.scoped(.CAresLookup, true); + const log = Output.scoped(.CAresLookup, .hidden); resolver: ?*Resolver, globalThis: *jsc.JSGlobalObject, @@ -1036,7 +1036,7 @@ pub fn CAresLookup(comptime cares_type: type, comptime type_name: []const u8) ty } pub const DNSLookup = struct { - const log = Output.scoped(.DNSLookup, false); + const log = Output.scoped(.DNSLookup, .visible); resolver: ?*Resolver, globalThis: *jsc.JSGlobalObject = undefined, @@ -1143,7 +1143,7 @@ pub const GlobalData = struct { }; pub const internal = struct { - const log = Output.scoped(.dns, true); + const log = Output.scoped(.dns, .hidden); var __max_dns_time_to_live_seconds: ?u32 = null; pub fn getMaxDNSTimeToLiveSeconds() u32 { @@ -1843,7 +1843,7 @@ pub const Resolver = struct { pub const ref = RefCount.ref; pub const deref = RefCount.deref; - const log = Output.scoped(.DNSResolver, false); + const log = Output.scoped(.DNSResolver, .visible); ref_count: RefCount, channel: ?*c_ares.Channel = null, diff --git a/src/bun.js/api/bun/h2_frame_parser.zig b/src/bun.js/api/bun/h2_frame_parser.zig index 54acac087b..ac5a34436b 100644 --- a/src/bun.js/api/bun/h2_frame_parser.zig +++ b/src/bun.js/api/bun/h2_frame_parser.zig @@ -98,7 +98,7 @@ const UInt31WithReserved = packed struct(u32) { reserved: bool = false, uint31: u31 = 0, - const log = Output.scoped(.UInt31WithReserved, false); + const log = Output.scoped(.UInt31WithReserved, .visible); pub inline fn from(value: u32) UInt31WithReserved { return .{ .uint31 = @truncate(value & 0x7fffffff), .reserved = value & 0x80000000 != 0 }; @@ -597,7 +597,7 @@ const Handlers = struct { pub const H2FrameParserConstructor = H2FrameParser.js.getConstructor; pub const H2FrameParser = struct { - pub const log = Output.scoped(.H2FrameParser, false); + pub const log = Output.scoped(.H2FrameParser, .visible); const Self = @This(); pub const js = jsc.Codegen.JSH2FrameParser; pub const toJS = js.toJS; diff --git a/src/bun.js/api/bun/process.zig b/src/bun.js/api/bun/process.zig index bcd2e88221..45c7e7d065 100644 --- a/src/bun.js/api/bun/process.zig +++ b/src/bun.js/api/bun/process.zig @@ -1,6 +1,6 @@ const pid_t = if (Environment.isPosix) std.posix.pid_t else uv.uv_pid_t; const fd_t = if (Environment.isPosix) std.posix.fd_t else i32; -const log = bun.Output.scoped(.PROCESS, false); +const log = bun.Output.scoped(.PROCESS, .visible); const win_rusage = struct { utime: struct { diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig index d6316cf302..c646fe4e28 100644 --- a/src/bun.js/api/bun/socket.zig +++ b/src/bun.js/api/bun/socket.zig @@ -1677,7 +1677,7 @@ const NativeCallbacks = union(enum) { } }; -const log = Output.scoped(.Socket, false); +const log = Output.scoped(.Socket, .visible); const WriteResult = union(enum) { fail: void, diff --git a/src/bun.js/api/bun/socket/Listener.zig b/src/bun.js/api/bun/socket/Listener.zig index e241a05542..8d6765edcc 100644 --- a/src/bun.js/api/bun/socket/Listener.zig +++ b/src/bun.js/api/bun/socket/Listener.zig @@ -829,7 +829,7 @@ pub fn jsAddServerName(global: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) b } return global.throw("Expected a Listener instance", .{}); } -pub const log = Output.scoped(.Listener, false); +pub const log = Output.scoped(.Listener, .visible); fn isValidPipeName(pipe_name: []const u8) bool { if (!Environment.isWindows) { diff --git a/src/bun.js/api/bun/socket/WindowsNamedPipeContext.zig b/src/bun.js/api/bun/socket/WindowsNamedPipeContext.zig index d51ee8b0d7..1795aef38a 100644 --- a/src/bun.js/api/bun/socket/WindowsNamedPipeContext.zig +++ b/src/bun.js/api/bun/socket/WindowsNamedPipeContext.zig @@ -22,7 +22,7 @@ pub const SocketType = union(enum) { }; pub const new = bun.TrivialNew(WindowsNamedPipeContext); -const log = Output.scoped(.WindowsNamedPipeContext, false); +const log = Output.scoped(.WindowsNamedPipeContext, .visible); fn onOpen(this: *WindowsNamedPipeContext) void { this.is_open = true; diff --git a/src/bun.js/api/bun/ssl_wrapper.zig b/src/bun.js/api/bun/ssl_wrapper.zig index be4ed15d02..829c4dea43 100644 --- a/src/bun.js/api/bun/ssl_wrapper.zig +++ b/src/bun.js/api/bun/ssl_wrapper.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.SSLWrapper, true); +const log = bun.Output.scoped(.SSLWrapper, .hidden); /// Mimics the behavior of openssl.c in uSockets, wrapping data that can be received from any where (network, DuplexStream, etc) pub fn SSLWrapper(comptime T: type) type { diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig index b4180bf04d..a1af7d9f42 100644 --- a/src/bun.js/api/bun/subprocess.zig +++ b/src/bun.js/api/bun/subprocess.zig @@ -170,7 +170,7 @@ pub fn appendEnvpFromJS(globalThis: *jsc.JSGlobalObject, object: *jsc.JSObject, } } -const log = Output.scoped(.Subprocess, false); +const log = Output.scoped(.Subprocess, .visible); pub const StdioKind = enum { stdin, stdout, @@ -829,7 +829,7 @@ pub fn NewStaticPipeWriter(comptime ProcessType: type) type { pub const ref = WriterRefCount.ref; pub const deref = WriterRefCount.deref; - const print = bun.Output.scoped(.StaticPipeWriter, false); + const print = bun.Output.scoped(.StaticPipeWriter, .visible); pub const IOWriter = bun.io.BufferedWriter(@This(), struct { pub const onWritable = null; @@ -2715,7 +2715,7 @@ pub fn getGlobalThis(this: *Subprocess) ?*jsc.JSGlobalObject { return this.globalThis; } -const IPClog = Output.scoped(.IPC, false); +const IPClog = Output.scoped(.IPC, .visible); const StdioResult = if (Environment.isWindows) bun.spawn.WindowsSpawnResult.StdioResult else ?bun.FileDescriptor; diff --git a/src/bun.js/api/bun/udp_socket.zig b/src/bun.js/api/bun/udp_socket.zig index 20f8179563..a5533b30f8 100644 --- a/src/bun.js/api/bun/udp_socket.zig +++ b/src/bun.js/api/bun/udp_socket.zig @@ -1,4 +1,4 @@ -const log = Output.scoped(.UdpSocket, false); +const log = Output.scoped(.UdpSocket, .visible); const INET6_ADDRSTRLEN = if (bun.Environment.isWindows) 65 else 46; diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig index f69e17f160..b499cdaf28 100644 --- a/src/bun.js/api/ffi.zig +++ b/src/bun.js/api/ffi.zig @@ -1,4 +1,4 @@ -const debug = Output.scoped(.TCC, false); +const debug = Output.scoped(.TCC, .visible); extern fn pthread_jit_write_protect_np(enable: c_int) void; diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig index bc4069177a..2ee193d213 100644 --- a/src/bun.js/api/html_rewriter.zig +++ b/src/bun.js/api/html_rewriter.zig @@ -387,7 +387,7 @@ pub const HTMLRewriter = struct { bodyValueBufferer: ?jsc.WebCore.Body.ValueBufferer = null, tmp_sync_error: ?*jsc.JSValue = null, - // const log = bun.Output.scoped(.BufferOutputSink, false); + // const log = bun.Output.scoped(.BufferOutputSink, .visible); pub fn init(context: *LOLHTMLContext, global: *JSGlobalObject, original: *Response, builder: *LOLHTML.HTMLRewriter.Builder) bun.JSError!jsc.JSValue { var sink = bun.new(BufferOutputSink, .{ .ref_count = .init(), diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 5552989545..72b8dc8a7d 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -1,5 +1,5 @@ -const httplog = Output.scoped(.Server, false); -const ctxLog = Output.scoped(.RequestContext, false); +const httplog = Output.scoped(.Server, .visible); +const ctxLog = Output.scoped(.RequestContext, .visible); pub const WebSocketServerContext = @import("./server/WebSocketServerContext.zig"); pub const HTTPStatusText = @import("./server/HTTPStatusText.zig"); diff --git a/src/bun.js/api/server/FileRoute.zig b/src/bun.js/api/server/FileRoute.zig index efbcebdff8..36d8f5d5bc 100644 --- a/src/bun.js/api/server/FileRoute.zig +++ b/src/bun.js/api/server/FileRoute.zig @@ -303,7 +303,7 @@ const StreamTransfer = struct { has_ended_response: bool = false, _: u7 = 0, } = .{}, - const log = Output.scoped(.StreamTransfer, false); + const log = Output.scoped(.StreamTransfer, .visible); pub fn create( fd: bun.FileDescriptor, diff --git a/src/bun.js/api/server/HTMLBundle.zig b/src/bun.js/api/server/HTMLBundle.zig index d5929b3372..2bf0ddc65d 100644 --- a/src/bun.js/api/server/HTMLBundle.zig +++ b/src/bun.js/api/server/HTMLBundle.zig @@ -504,7 +504,7 @@ pub const Route = struct { }; }; -const debug = bun.Output.scoped(.HTMLBundle, true); +const debug = bun.Output.scoped(.HTMLBundle, .hidden); const StaticRoute = @import("./StaticRoute.zig"); const std = @import("std"); diff --git a/src/bun.js/api/server/NodeHTTPResponse.zig b/src/bun.js/api/server/NodeHTTPResponse.zig index d24a7c1d02..408693cae2 100644 --- a/src/bun.js/api/server/NodeHTTPResponse.zig +++ b/src/bun.js/api/server/NodeHTTPResponse.zig @@ -1,6 +1,6 @@ const NodeHTTPResponse = @This(); -const log = bun.Output.scoped(.NodeHTTPResponse, false); +const log = bun.Output.scoped(.NodeHTTPResponse, .visible); pub const js = jsc.Codegen.JSNodeHTTPResponse; pub const toJS = js.toJS; diff --git a/src/bun.js/api/server/RequestContext.zig b/src/bun.js/api/server/RequestContext.zig index 0fab727ada..66bd81e229 100644 --- a/src/bun.js/api/server/RequestContext.zig +++ b/src/bun.js/api/server/RequestContext.zig @@ -1235,7 +1235,7 @@ pub fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, this.renderMissing(); } - const streamLog = Output.scoped(.ReadableStream, false); + const streamLog = Output.scoped(.ReadableStream, .visible); pub fn didUpgradeWebSocket(this: *RequestContext) bool { return @intFromPtr(this.upgrade_context) == std.math.maxInt(usize); @@ -2519,7 +2519,7 @@ fn writeHeaders( } } -const ctxLog = Output.scoped(.RequestContext, false); +const ctxLog = Output.scoped(.RequestContext, .visible); const string = []const u8; const std = @import("std"); diff --git a/src/bun.js/api/server/ServerWebSocket.zig b/src/bun.js/api/server/ServerWebSocket.zig index 9d0c1a3d57..d2b3160fa9 100644 --- a/src/bun.js/api/server/ServerWebSocket.zig +++ b/src/bun.js/api/server/ServerWebSocket.zig @@ -43,7 +43,7 @@ pub fn memoryCost(this: *const ServerWebSocket) usize { return this.websocket().memoryCost() + @sizeOf(ServerWebSocket); } -const log = Output.scoped(.WebSocketServer, false); +const log = Output.scoped(.WebSocketServer, .visible); pub fn onOpen(this: *ServerWebSocket, ws: uws.AnyWebSocket) void { log("OnOpen", .{}); diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig index 06c319debb..98c3edca2a 100644 --- a/src/bun.js/event_loop.zig +++ b/src/bun.js/event_loop.zig @@ -98,7 +98,7 @@ pub fn pipeReadBuffer(this: *const EventLoop) []u8 { } pub const Queue = std.fifo.LinearFifo(Task, .Dynamic); -const log = bun.Output.scoped(.EventLoop, false); +const log = bun.Output.scoped(.EventLoop, .visible); pub fn tickWhilePaused(this: *EventLoop, done: *bool) void { while (!done.*) { diff --git a/src/bun.js/event_loop/PosixSignalHandle.zig b/src/bun.js/event_loop/PosixSignalHandle.zig index 1e793eacc0..ed36f28ea6 100644 --- a/src/bun.js/event_loop/PosixSignalHandle.zig +++ b/src/bun.js/event_loop/PosixSignalHandle.zig @@ -9,7 +9,7 @@ tail: std.atomic.Value(u16) = std.atomic.Value(u16).init(0), // Consumer index (main thread reads). head: std.atomic.Value(u16) = std.atomic.Value(u16).init(0), -const log = bun.Output.scoped(.PosixSignalHandle, true); +const log = bun.Output.scoped(.PosixSignalHandle, .hidden); pub const new = bun.TrivialNew(@This()); diff --git a/src/bun.js/event_loop/Task.zig b/src/bun.js/event_loop/Task.zig index fbdf1db9d3..e4a4ed793b 100644 --- a/src/bun.js/event_loop/Task.zig +++ b/src/bun.js/event_loop/Task.zig @@ -516,7 +516,7 @@ pub fn tickQueueWithCount(this: *EventLoop, virtual_machine: *VirtualMachine) u3 // const ShellIOReaderAsyncDeinit = shell.Interpreter.IOReader.AsyncDeinit; const ProcessWaiterThreadTask = if (Environment.isPosix) bun.spawn.process.WaiterThread.ProcessQueue.ResultTask else opaque {}; -const log = bun.Output.scoped(.Task, true); +const log = bun.Output.scoped(.Task, .hidden); const Fetch = @import("../webcore/fetch.zig"); const FetchTasklet = Fetch.FetchTasklet; diff --git a/src/bun.js/hot_reloader.zig b/src/bun.js/hot_reloader.zig index da262511be..e567078278 100644 --- a/src/bun.js/hot_reloader.zig +++ b/src/bun.js/hot_reloader.zig @@ -86,7 +86,7 @@ pub fn NewHotReloader(comptime Ctx: type, comptime EventLoopType: type, comptime fn debug(comptime fmt: string, args: anytype) void { if (Environment.enable_logs) { - Output.scoped(.hot_reloader, false)(fmt, args); + Output.scoped(.hot_reloader, .visible)(fmt, args); } else { Output.prettyErrorln("watcher: " ++ fmt, args); } diff --git a/src/bun.js/ipc.zig b/src/bun.js/ipc.zig index bfe5b46375..d9dec7488c 100644 --- a/src/bun.js/ipc.zig +++ b/src/bun.js/ipc.zig @@ -1,4 +1,4 @@ -pub const log = Output.scoped(.IPC, false); +pub const log = Output.scoped(.IPC, .visible); const IsInternal = enum { internal, external }; const SerializeAndSendResult = enum { diff --git a/src/bun.js/jsc.zig b/src/bun.js/jsc.zig index 6249c9cc7a..e5cd97912a 100644 --- a/src/bun.js/jsc.zig +++ b/src/bun.js/jsc.zig @@ -163,7 +163,7 @@ pub const API = bun.api; /// Deprecated: Use `bun.api.node` pub const Node = bun.api.node; -const log = bun.Output.scoped(.JSC, true); +const log = bun.Output.scoped(.JSC, .hidden); pub inline fn markBinding(src: std.builtin.SourceLocation) void { log("{s} ({s}:{d})", .{ src.fn_name, src.file, src.line }); } diff --git a/src/bun.js/jsc/array_buffer.zig b/src/bun.js/jsc/array_buffer.zig index 0af270dbca..c800d67015 100644 --- a/src/bun.js/jsc/array_buffer.zig +++ b/src/bun.js/jsc/array_buffer.zig @@ -248,7 +248,7 @@ pub const ArrayBuffer = extern struct { ); } - const log = Output.scoped(.ArrayBuffer, false); + const log = Output.scoped(.ArrayBuffer, .visible); pub fn toJS(this: ArrayBuffer, ctx: *jsc.JSGlobalObject) bun.JSError!jsc.JSValue { if (this.value != .zero) { diff --git a/src/bun.js/node/node_cluster_binding.zig b/src/bun.js/node/node_cluster_binding.zig index 176694b211..2d77be20f7 100644 --- a/src/bun.js/node/node_cluster_binding.zig +++ b/src/bun.js/node/node_cluster_binding.zig @@ -3,7 +3,7 @@ // - These sequence numbers and ACKs shouldn't exist from JavaScript's perspective // at all. It should happen in the protocol before it reaches JS. // - We should not be creating JSFunction's in process.nextTick. -const log = Output.scoped(.IPC, false); +const log = Output.scoped(.IPC, .visible); extern fn Bun__Process__queueNextTick1(*jsc.JSGlobalObject, jsc.JSValue, jsc.JSValue) void; extern fn Process__emitErrorEvent(global: *jsc.JSGlobalObject, value: jsc.JSValue) void; diff --git a/src/bun.js/node/node_fs_stat_watcher.zig b/src/bun.js/node/node_fs_stat_watcher.zig index 5bb0dec2c7..22277a38e2 100644 --- a/src/bun.js/node/node_fs_stat_watcher.zig +++ b/src/bun.js/node/node_fs_stat_watcher.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.StatWatcher, false); +const log = bun.Output.scoped(.StatWatcher, .visible); fn statToJSStats(globalThis: *jsc.JSGlobalObject, stats: *const bun.Stat, bigint: bool) bun.JSError!jsc.JSValue { if (bigint) { diff --git a/src/bun.js/node/node_fs_watcher.zig b/src/bun.js/node/node_fs_watcher.zig index 00ab25394b..ff732fd413 100644 --- a/src/bun.js/node/node_fs_watcher.zig +++ b/src/bun.js/node/node_fs_watcher.zig @@ -1,4 +1,4 @@ -const log = Output.scoped(.@"fs.watch", true); +const log = Output.scoped(.@"fs.watch", .hidden); const PathWatcher = if (Environment.isWindows) @import("./win_watcher.zig") else @import("./path_watcher.zig"); // TODO: make this a top-level struct diff --git a/src/bun.js/node/node_zlib_binding.zig b/src/bun.js/node/node_zlib_binding.zig index c9b4824020..1e7394054a 100644 --- a/src/bun.js/node/node_zlib_binding.zig +++ b/src/bun.js/node/node_zlib_binding.zig @@ -1,4 +1,4 @@ -const debug = bun.Output.scoped(.zlib, true); +const debug = bun.Output.scoped(.zlib, .hidden); pub fn crc32(globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!jsc.JSValue { const arguments = callframe.arguments_old(2).ptr; diff --git a/src/bun.js/node/path_watcher.zig b/src/bun.js/node/path_watcher.zig index dd50f02f98..6674d6cd5e 100644 --- a/src/bun.js/node/path_watcher.zig +++ b/src/bun.js/node/path_watcher.zig @@ -3,7 +3,7 @@ var default_manager: ?*PathWatcherManager = null; pub const PathWatcherManager = struct { const options = @import("../../options.zig"); - const log = Output.scoped(.PathWatcherManager, false); + const log = Output.scoped(.PathWatcherManager, .visible); main_watcher: *Watcher, watchers: bun.BabyList(?*PathWatcher) = .{}, diff --git a/src/bun.js/node/util/parse_args.zig b/src/bun.js/node/util/parse_args.zig index f4d5d96b29..2d9e1205fb 100644 --- a/src/bun.js/node/util/parse_args.zig +++ b/src/bun.js/node/util/parse_args.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.parseArgs, true); +const log = bun.Output.scoped(.parseArgs, .hidden); /// Represents a slice of a JSValue array const ArgsSlice = struct { diff --git a/src/bun.js/node/win_watcher.zig b/src/bun.js/node/win_watcher.zig index 4148e16d0f..b67171cd3e 100644 --- a/src/bun.js/node/win_watcher.zig +++ b/src/bun.js/node/win_watcher.zig @@ -4,7 +4,7 @@ var default_manager: ?*PathWatcherManager = null; // TODO: we probably should use native instead of libuv abstraction here for better performance pub const PathWatcherManager = struct { const options = @import("../../options.zig"); - const log = Output.scoped(.PathWatcherManager, false); + const log = Output.scoped(.PathWatcherManager, .visible); watchers: bun.StringArrayHashMapUnmanaged(*PathWatcher) = .{}, vm: *jsc.VirtualMachine, @@ -71,7 +71,7 @@ pub const PathWatcher = struct { pub const new = bun.TrivialNew(PathWatcher); - const log = Output.scoped(.@"fs.watch", false); + const log = Output.scoped(.@"fs.watch", .visible); pub const ChangeEvent = struct { hash: Watcher.HashType = 0, diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index ffe7318c88..e661b241dd 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -6,7 +6,7 @@ pub const Tag = enum(u3) { todo, skipped_because_label, }; -const debug = Output.scoped(.jest, false); +const debug = Output.scoped(.jest, .visible); var max_test_id_for_debugger: u32 = 0; diff --git a/src/bun.js/test/snapshot.zig b/src/bun.js/test/snapshot.zig index a22caaaed4..c1496615a6 100644 --- a/src/bun.js/test/snapshot.zig +++ b/src/bun.js/test/snapshot.zig @@ -201,7 +201,7 @@ pub const Snapshots = struct { try gpres.value_ptr.append(value); } - const inline_snapshot_dbg = bun.Output.scoped(.inline_snapshot, false); + const inline_snapshot_dbg = bun.Output.scoped(.inline_snapshot, .visible); pub fn writeInlineSnapshots(this: *Snapshots) !bool { var arena_backing = bun.ArenaAllocator.init(this.allocator); defer arena_backing.deinit(); diff --git a/src/bun.js/web_worker.zig b/src/bun.js/web_worker.zig index 4eddf44120..b3b80b8aae 100644 --- a/src/bun.js/web_worker.zig +++ b/src/bun.js/web_worker.zig @@ -2,7 +2,7 @@ const WebWorker = @This(); -const log = Output.scoped(.Worker, true); +const log = Output.scoped(.Worker, .hidden); /// null when haven't started yet vm: ?*jsc.VirtualMachine = null, diff --git a/src/bun.js/webcore/Blob.zig b/src/bun.js/webcore/Blob.zig index b17d48043f..363be1758f 100644 --- a/src/bun.js/webcore/Blob.zig +++ b/src/bun.js/webcore/Blob.zig @@ -6,7 +6,7 @@ const Blob = @This(); -const debug = Output.scoped(.Blob, false); +const debug = Output.scoped(.Blob, .visible); pub const Store = @import("./blob/Store.zig"); pub const read_file = @import("./blob/read_file.zig"); diff --git a/src/bun.js/webcore/Body.zig b/src/bun.js/webcore/Body.zig index 99c34ebc90..e221843314 100644 --- a/src/bun.js/webcore/Body.zig +++ b/src/bun.js/webcore/Body.zig @@ -219,7 +219,7 @@ pub const PendingValue = struct { /// This is a duplex stream! pub const Value = union(Tag) { - const log = Output.scoped(.BodyValue, false); + const log = Output.scoped(.BodyValue, .visible); const pool_size = if (bun.heap_breakdown.enabled) 0 else 256; pub const HiveRef = bun.HiveRef(jsc.WebCore.Body.Value, pool_size); @@ -1322,7 +1322,7 @@ pub fn Mixin(comptime Type: type) type { } pub const ValueBufferer = struct { - const log = bun.Output.scoped(.BodyValueBufferer, false); + const log = bun.Output.scoped(.BodyValueBufferer, .visible); const ArrayBufferSink = bun.webcore.Sink.ArrayBufferSink; const Callback = *const fn (ctx: *anyopaque, bytes: []const u8, err: ?Body.Value.ValueError, is_async: bool) void; diff --git a/src/bun.js/webcore/ByteStream.zig b/src/bun.js/webcore/ByteStream.zig index 17db981c7e..91cdf6e395 100644 --- a/src/bun.js/webcore/ByteStream.zig +++ b/src/bun.js/webcore/ByteStream.zig @@ -29,7 +29,7 @@ pub const Source = webcore.ReadableStream.NewSource( toBufferedValue, ); -const log = Output.scoped(.ByteStream, false); +const log = Output.scoped(.ByteStream, .visible); pub const tag = webcore.ReadableStream.Tag.Bytes; diff --git a/src/bun.js/webcore/FileReader.zig b/src/bun.js/webcore/FileReader.zig index c226ad0227..3d700aef92 100644 --- a/src/bun.js/webcore/FileReader.zig +++ b/src/bun.js/webcore/FileReader.zig @@ -1,6 +1,6 @@ const FileReader = @This(); -const log = Output.scoped(.FileReader, false); +const log = Output.scoped(.FileReader, .visible); reader: IOReader = IOReader.init(FileReader), done: bool = false, diff --git a/src/bun.js/webcore/FileSink.zig b/src/bun.js/webcore/FileSink.zig index a2c995ae95..89309b3bd5 100644 --- a/src/bun.js/webcore/FileSink.zig +++ b/src/bun.js/webcore/FileSink.zig @@ -27,7 +27,7 @@ run_pending_later: FlushPendingTask = .{}, /// Currently, only used when `stdin` in `Bun.spawn` is a ReadableStream. readable_stream: jsc.WebCore.ReadableStream.Strong = .{}, -const log = Output.scoped(.FileSink, false); +const log = Output.scoped(.FileSink, .visible); pub const RefCount = bun.ptr.RefCount(FileSink, "ref_count", deinit, .{}); pub const ref = RefCount.ref; diff --git a/src/bun.js/webcore/ResumableSink.zig b/src/bun.js/webcore/ResumableSink.zig index 2ea3a8d103..11df2ea90c 100644 --- a/src/bun.js/webcore/ResumableSink.zig +++ b/src/bun.js/webcore/ResumableSink.zig @@ -10,7 +10,7 @@ pub fn ResumableSink( comptime onEnd: fn (context: *Context, err: ?jsc.JSValue) void, ) type { return struct { - const log = bun.Output.scoped(.ResumableSink, false); + const log = bun.Output.scoped(.ResumableSink, .visible); pub const toJS = js.toJS; pub const fromJS = js.fromJS; pub const fromJSDirect = js.fromJSDirect; diff --git a/src/bun.js/webcore/S3Client.zig b/src/bun.js/webcore/S3Client.zig index 5502ae7472..efd1f30fbe 100644 --- a/src/bun.js/webcore/S3Client.zig +++ b/src/bun.js/webcore/S3Client.zig @@ -77,7 +77,7 @@ pub fn writeFormatCredentials(credentials: *S3Credentials, options: bun.S3.Multi } pub const S3Client = struct { - const log = bun.Output.scoped(.S3Client, false); + const log = bun.Output.scoped(.S3Client, .visible); pub const js = jsc.Codegen.JSS3Client; pub const toJS = js.toJS; pub const fromJS = js.fromJS; diff --git a/src/bun.js/webcore/S3Stat.zig b/src/bun.js/webcore/S3Stat.zig index 6cbb0e1c3f..4324a91235 100644 --- a/src/bun.js/webcore/S3Stat.zig +++ b/src/bun.js/webcore/S3Stat.zig @@ -1,5 +1,5 @@ pub const S3Stat = struct { - const log = bun.Output.scoped(.S3Stat, false); + const log = bun.Output.scoped(.S3Stat, .visible); pub const js = jsc.Codegen.JSS3Stat; pub const toJS = js.toJS; pub const fromJS = js.fromJS; diff --git a/src/bun.js/webcore/TextEncoderStreamEncoder.zig b/src/bun.js/webcore/TextEncoderStreamEncoder.zig index d05e240934..e15f1971b5 100644 --- a/src/bun.js/webcore/TextEncoderStreamEncoder.zig +++ b/src/bun.js/webcore/TextEncoderStreamEncoder.zig @@ -2,7 +2,7 @@ const TextEncoderStreamEncoder = @This(); pending_lead_surrogate: ?u16 = null, -const log = Output.scoped(.TextEncoderStreamEncoder, false); +const log = Output.scoped(.TextEncoderStreamEncoder, .visible); pub const js = jsc.Codegen.JSTextEncoderStreamEncoder; pub const toJS = js.toJS; diff --git a/src/bun.js/webcore/blob/read_file.zig b/src/bun.js/webcore/blob/read_file.zig index c5b5e1df4c..0758c872de 100644 --- a/src/bun.js/webcore/blob/read_file.zig +++ b/src/bun.js/webcore/blob/read_file.zig @@ -1,6 +1,6 @@ -const bloblog = bun.Output.scoped(.WriteFile, true); +const bloblog = bun.Output.scoped(.WriteFile, .hidden); -const log = bun.Output.scoped(.ReadFile, true); +const log = bun.Output.scoped(.ReadFile, .hidden); pub fn NewReadFileHandler(comptime Function: anytype) type { return struct { diff --git a/src/bun.js/webcore/blob/write_file.zig b/src/bun.js/webcore/blob/write_file.zig index 85abe75607..e72f49e32f 100644 --- a/src/bun.js/webcore/blob/write_file.zig +++ b/src/bun.js/webcore/blob/write_file.zig @@ -353,7 +353,7 @@ pub const WriteFileWindows = struct { owned_fd: bool = false, - const log = bun.Output.scoped(.WriteFile, true); + const log = bun.Output.scoped(.WriteFile, .hidden); pub fn createWithCtx( file_blob: Blob, @@ -721,7 +721,7 @@ pub const WriteFileWaitFromLockedValueTask = struct { } }; -const bloblog = bun.Output.scoped(.WriteFile, true); +const bloblog = bun.Output.scoped(.WriteFile, .hidden); const std = @import("std"); diff --git a/src/bun.js/webcore/fetch.zig b/src/bun.js/webcore/fetch.zig index a874032b84..6c113a30c3 100644 --- a/src/bun.js/webcore/fetch.zig +++ b/src/bun.js/webcore/fetch.zig @@ -61,7 +61,7 @@ pub const fetch_type_error_strings: JSTypeErrorEnum = brk: { pub const FetchTasklet = struct { pub const ResumableSink = jsc.WebCore.ResumableFetchSink; - const log = Output.scoped(.FetchTasklet, false); + const log = Output.scoped(.FetchTasklet, .visible); sink: ?*ResumableSink = null, http: ?*http.AsyncHTTP = null, result: http.HTTPClientResult = .{}, diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig index 74a6791713..b4424c2fc2 100644 --- a/src/bun.js/webcore/streams.zig +++ b/src/bun.js/webcore/streams.zig @@ -729,7 +729,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type { auto_flusher: WebCore.AutoFlusher = .{}, - const log = Output.scoped(.HTTPServerWritable, false); + const log = Output.scoped(.HTTPServerWritable, .visible); pub fn connect(this: *@This(), signal: Signal) void { this.signal = signal; @@ -1350,7 +1350,7 @@ pub const NetworkSink = struct { done: bool = false, cancel: bool = false, - const log = bun.Output.scoped(.NetworkSink, false); + const log = bun.Output.scoped(.NetworkSink, .visible); fn getHighWaterMark(this: *@This()) Blob.SizeType { if (this.task) |task| { diff --git a/src/bun.zig b/src/bun.zig index ab0d437d6d..7576246022 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -1932,7 +1932,7 @@ pub const Wyhash11 = @import("./wyhash.zig").Wyhash11; pub const RegularExpression = @import("./bun.js/bindings/RegularExpression.zig").RegularExpression; -const TODO_LOG = Output.scoped(.TODO, false); +const TODO_LOG = Output.scoped(.TODO, .visible); pub inline fn todo(src: std.builtin.SourceLocation, value: anytype) @TypeOf(value) { if (comptime Environment.allow_assert) { TODO_LOG("{s}() at {s}:{d}:{d}", .{ src.fn_name, src.file, src.line, src.column }); @@ -2658,8 +2658,7 @@ pub inline fn new(comptime T: type, init: T) *T { }; if (comptime Environment.allow_assert) { - const enable_logs = @hasDecl(T, "logAllocations"); - const logAlloc = Output.scoped(.alloc, !enable_logs); + const logAlloc = Output.scoped(.alloc, .visibleIf(@hasDecl(T, "logAllocations"))); logAlloc("new({s}) = {*}", .{ meta.typeName(T), pointer }); } @@ -2676,8 +2675,7 @@ pub inline fn destroy(pointer: anytype) void { const T = std.meta.Child(@TypeOf(pointer)); if (Environment.allow_assert) { - const enable_logs = @hasDecl(T, "logAllocations"); - const logAlloc = Output.scoped(.alloc, !enable_logs); + const logAlloc = Output.scoped(.alloc, .visibleIf(@hasDecl(T, "logAllocations"))); logAlloc("destroy({s}) = {*}", .{ meta.typeName(T), pointer }); // If this type implements a RefCount, make sure it is zero. diff --git a/src/bundler/LinkerContext.zig b/src/bundler/LinkerContext.zig index eaeed8b879..d73497b9bb 100644 --- a/src/bundler/LinkerContext.zig +++ b/src/bundler/LinkerContext.zig @@ -1,5 +1,5 @@ pub const LinkerContext = struct { - pub const debug = Output.scoped(.LinkerCtx, false); + pub const debug = Output.scoped(.LinkerCtx, .visible); pub const CompileResult = bundler.CompileResult; pub const OutputFileListBuilder = @import("./linker_context/OutputFileListBuilder.zig"); @@ -2506,7 +2506,7 @@ pub const ThreadPoolLib = bun.ThreadPool; pub const Fs = @import("../fs.zig"); pub const Index = bun.ast.Index; -const debugTreeShake = Output.scoped(.TreeShake, true); +const debugTreeShake = Output.scoped(.TreeShake, .hidden); pub const DeferredBatchTask = bun.bundle_v2.DeferredBatchTask; pub const ThreadPool = bun.bundle_v2.ThreadPool; diff --git a/src/bundler/LinkerGraph.zig b/src/bundler/LinkerGraph.zig index 1fabfea6d0..bec4e3d392 100644 --- a/src/bundler/LinkerGraph.zig +++ b/src/bundler/LinkerGraph.zig @@ -1,6 +1,6 @@ pub const LinkerGraph = @This(); -const debug = Output.scoped(.LinkerGraph, false); +const debug = Output.scoped(.LinkerGraph, .visible); files: File.List = .{}, files_live: BitSet = undefined, diff --git a/src/bundler/ParseTask.zig b/src/bundler/ParseTask.zig index 6f876152ba..67c8ea38b5 100644 --- a/src/bundler/ParseTask.zig +++ b/src/bundler/ParseTask.zig @@ -101,7 +101,7 @@ pub const Result = struct { }; }; -const debug = Output.scoped(.ParseTask, true); +const debug = Output.scoped(.ParseTask, .hidden); pub fn init(resolve_result: *const _resolver.Result, source_index: Index, ctx: *BundleV2) ParseTask { return .{ diff --git a/src/bundler/ThreadPool.zig b/src/bundler/ThreadPool.zig index 08dc31e217..31f878b283 100644 --- a/src/bundler/ThreadPool.zig +++ b/src/bundler/ThreadPool.zig @@ -11,7 +11,7 @@ pub const ThreadPool = struct { workers_assignments_lock: bun.Mutex = .{}, v2: *BundleV2, - const debug = Output.scoped(.ThreadPool, false); + const debug = Output.scoped(.ThreadPool, .visible); const IOThreadPool = struct { var thread_pool: ThreadPoolLib = undefined; diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index 29cb182163..6fb2e081e8 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -42,7 +42,7 @@ // make mimalloc-debug // -pub const logPartDependencyTree = Output.scoped(.part_dep_tree, false); +pub const logPartDependencyTree = Output.scoped(.part_dep_tree, .visible); pub const MangledProps = std.AutoArrayHashMapUnmanaged(Ref, []const u8); pub const PathToSourceIndexMap = std.HashMapUnmanaged(u64, Index.Int, IdentityContext(u64), 80); @@ -149,7 +149,7 @@ pub const BundleV2 = struct { plugins: ?*jsc.API.JSBundler.Plugin, }; - const debug = Output.scoped(.Bundle, false); + const debug = Output.scoped(.Bundle, .visible); pub inline fn loop(this: *BundleV2) *EventLoop { return &this.linker.loop; @@ -415,7 +415,7 @@ pub const BundleV2 = struct { }, } - const DebugLog = bun.Output.Scoped(.ReachableFiles, false); + const DebugLog = bun.Output.Scoped(.ReachableFiles, .visible); if (DebugLog.isVisible()) { DebugLog.log("Reachable count: {d} / {d}", .{ visitor.reachable.items.len, this.graph.input_files.len }); const sources: []Logger.Source = this.graph.input_files.items(.source); @@ -883,7 +883,7 @@ pub const BundleV2 = struct { return this; } - const logScanCounter = bun.Output.scoped(.scan_counter, false); + const logScanCounter = bun.Output.scoped(.scan_counter, .visible); pub fn incrementScanCounter(this: *BundleV2) void { this.thread_lock.assertLocked(); @@ -2861,7 +2861,7 @@ pub const BundleV2 = struct { if (err == error.ModuleNotFound) { if (this.bun_watcher != null) { if (!had_busted_dir_cache) { - bun.Output.scoped(.watcher, false)("busting dir cache {s} -> {s}", .{ source.path.text, import_record.path.text }); + bun.Output.scoped(.watcher, .visible)("busting dir cache {s} -> {s}", .{ source.path.text, import_record.path.text }); // Only re-query if we previously had something cached. if (transpiler.resolver.bustDirCacheFromSpecifier( source.path.text, @@ -3972,7 +3972,7 @@ pub const ContentHasher = struct { // xxhash64 outperforms Wyhash if the file is > 1KB or so hasher: Hash = .init(0), - const log = bun.Output.scoped(.ContentHasher, true); + const log = bun.Output.scoped(.ContentHasher, .hidden); pub fn write(self: *ContentHasher, bytes: []const u8) void { log("HASH_UPDATE {d}:\n{s}\n----------\n", .{ bytes.len, std.mem.sliceAsBytes(bytes) }); @@ -4194,8 +4194,8 @@ pub const StableSymbolCount = renamer.StableSymbolCount; pub const MinifyRenamer = renamer.MinifyRenamer; pub const Scope = js_ast.Scope; pub const jsc = bun.jsc; -pub const debugTreeShake = Output.scoped(.TreeShake, true); -pub const debugPartRanges = Output.scoped(.PartRanges, true); +pub const debugTreeShake = Output.scoped(.TreeShake, .hidden); +pub const debugPartRanges = Output.scoped(.PartRanges, .hidden); pub const BitSet = bun.bit_set.DynamicBitSetUnmanaged; pub const Async = bun.Async; pub const Loc = Logger.Loc; diff --git a/src/bundler/linker_context/generateChunksInParallel.zig b/src/bundler/linker_context/generateChunksInParallel.zig index d4a33f371c..90bac34b20 100644 --- a/src/bundler/linker_context/generateChunksInParallel.zig +++ b/src/bundler/linker_context/generateChunksInParallel.zig @@ -547,7 +547,7 @@ pub fn generateChunksInParallel( pub const ThreadPool = bun.bundle_v2.ThreadPool; -const debugPartRanges = Output.scoped(.PartRanges, true); +const debugPartRanges = Output.scoped(.PartRanges, .hidden); const std = @import("std"); diff --git a/src/cache.zig b/src/cache.zig index 89b75aea00..772b5c42bc 100644 --- a/src/cache.zig +++ b/src/cache.zig @@ -14,7 +14,7 @@ pub const Set = struct { }; } }; -const debug = Output.scoped(.fs, false); +const debug = Output.scoped(.fs, .visible); pub const Fs = struct { pub const Entry = struct { contents: string, diff --git a/src/cli.zig b/src/cli.zig index 05f6b438b0..1dba479163 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -1,4 +1,4 @@ -const debug = Output.scoped(.CLI, true); +const debug = Output.scoped(.CLI, .hidden); pub var start_time: i128 = undefined; diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig index 467a9fef56..1f10518ed4 100644 --- a/src/cli/bunx_command.zig +++ b/src/cli/bunx_command.zig @@ -1,4 +1,4 @@ -const debug = Output.scoped(.bunx, false); +const debug = Output.scoped(.bunx, .visible); pub const BunxCommand = struct { var path_buf: bun.PathBuffer = undefined; diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index 800d3a87cb..06488fbee9 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -203,7 +203,7 @@ pub const RunCommand = struct { } } - const log = Output.scoped(.RUN, false); + const log = Output.scoped(.RUN, .visible); pub fn runPackageScriptForeground( ctx: Command.Context, @@ -1639,7 +1639,7 @@ pub const RunCommand = struct { pub const BunXFastPath = struct { const shim_impl = @import("../install/windows-shim/bun_shim_impl.zig"); - const debug = Output.scoped(.BunXFastPath, false); + const debug = Output.scoped(.BunXFastPath, .visible); var direct_launch_buffer: bun.WPathBuffer = undefined; var environment_buffer: bun.WPathBuffer = undefined; diff --git a/src/cli/test/Scanner.zig b/src/cli/test/Scanner.zig index 8f4369a919..73a1634530 100644 --- a/src/cli/test/Scanner.zig +++ b/src/cli/test/Scanner.zig @@ -15,7 +15,7 @@ options: *BundleOptions, has_iterated: bool = false, search_count: usize = 0, -const log = bun.Output.scoped(.jest, true); +const log = bun.Output.scoped(.jest, .hidden); const Fifo = std.fifo.LinearFifo(ScanEntry, .Dynamic); const ScanEntry = struct { relative_dir: bun.StoredFileDescriptorType, diff --git a/src/codegen/generate-classes.ts b/src/codegen/generate-classes.ts index fcb59248a9..ba4039e2fb 100644 --- a/src/codegen/generate-classes.ts +++ b/src/codegen/generate-classes.ts @@ -2495,7 +2495,7 @@ const jsc = bun.jsc; const Classes = jsc.GeneratedClassesList; const Environment = bun.Environment; const std = @import("std"); -const zig = bun.Output.scoped(.zig, true); +const zig = bun.Output.scoped(.zig, .hidden); const wrapHostFunction = bun.gen_classes_lib.wrapHostFunction; const wrapMethod = bun.gen_classes_lib.wrapMethod; diff --git a/src/copy_file.zig b/src/copy_file.zig index 5255e965f8..08093297cb 100644 --- a/src/copy_file.zig +++ b/src/copy_file.zig @@ -294,7 +294,7 @@ pub fn copyFileReadWriteLoop( } } -const debug = bun.Output.scoped(.copy_file, true); +const debug = bun.Output.scoped(.copy_file, .hidden); const bun = @import("bun"); const Environment = bun.Environment; diff --git a/src/css/rules/rules.zig b/src/css/rules/rules.zig index cda76ef453..8e1294df40 100644 --- a/src/css/rules/rules.zig +++ b/src/css/rules/rules.zig @@ -29,7 +29,7 @@ pub const starting_style = @import("./starting_style.zig"); pub const tailwind = @import("./tailwind.zig"); -const debug = bun.Output.scoped(.CSS_MINIFY, false); +const debug = bun.Output.scoped(.CSS_MINIFY, .visible); pub fn CssRule(comptime Rule: type) type { return union(enum) { diff --git a/src/css/selectors/selector.zig b/src/css/selectors/selector.zig index 90fee96ea4..d33e4b45aa 100644 --- a/src/css/selectors/selector.zig +++ b/src/css/selectors/selector.zig @@ -11,7 +11,7 @@ pub const Component = parser.Component; pub const PseudoClass = parser.PseudoClass; pub const PseudoElement = parser.PseudoElement; -const debug = bun.Output.scoped(.CSS_SELECTORS, false); +const debug = bun.Output.scoped(.CSS_SELECTORS, .visible); /// Our implementation of the `SelectorImpl` interface /// diff --git a/src/deps/libuv.zig b/src/deps/libuv.zig index 433ac15afb..220d439973 100644 --- a/src/deps/libuv.zig +++ b/src/deps/libuv.zig @@ -4,7 +4,7 @@ const SOCKET = *anyopaque; const LPFN_ACCEPTEX = *const anyopaque; const LPFN_CONNECTEX = *const anyopaque; -pub const log = bun.Output.scoped(.uv, true); +pub const log = bun.Output.scoped(.uv, .hidden); pub const CHAR = u8; pub const SHORT = c_short; diff --git a/src/deps/uws/Loop.zig b/src/deps/uws/Loop.zig index 9cfc9a7da3..8eeff0adda 100644 --- a/src/deps/uws/Loop.zig +++ b/src/deps/uws/Loop.zig @@ -289,7 +289,7 @@ const c = struct { pub extern fn uws_res_clear_corked_socket(loop: *Loop) void; }; -const log = bun.Output.scoped(.Loop, false); +const log = bun.Output.scoped(.Loop, .visible); const std = @import("std"); diff --git a/src/deps/uws/SocketContext.zig b/src/deps/uws/SocketContext.zig index 51e679d98c..d2737f270f 100644 --- a/src/deps/uws/SocketContext.zig +++ b/src/deps/uws/SocketContext.zig @@ -280,7 +280,7 @@ pub const c = struct { pub extern fn create_ssl_context_from_bun_options(options: SocketContext.BunSocketContextOptions, err: *create_bun_socket_error_t) ?*BoringSSL.SSL_CTX; }; -const debug = bun.Output.scoped(.uws, false); +const debug = bun.Output.scoped(.uws, .visible); const std = @import("std"); diff --git a/src/deps/uws/Timer.zig b/src/deps/uws/Timer.zig index 1a075de20c..745521f924 100644 --- a/src/deps/uws/Timer.zig +++ b/src/deps/uws/Timer.zig @@ -55,7 +55,7 @@ const c = struct { pub extern fn us_timer_loop(t: ?*Timer) ?*Loop; }; -const debug = bun.Output.scoped(.uws, false); +const debug = bun.Output.scoped(.uws, .visible); const bun = @import("bun"); const std = @import("std"); diff --git a/src/deps/uws/UpgradedDuplex.zig b/src/deps/uws/UpgradedDuplex.zig index 497a0a4a9c..515a73f2d4 100644 --- a/src/deps/uws/UpgradedDuplex.zig +++ b/src/deps/uws/UpgradedDuplex.zig @@ -478,7 +478,7 @@ pub fn deinit(this: *UpgradedDuplex) void { this.ssl_error = .{}; } -const log = bun.Output.scoped(.UpgradedDuplex, false); +const log = bun.Output.scoped(.UpgradedDuplex, .visible); const SSLWrapper = @import("../../bun.js/api/bun/ssl_wrapper.zig").SSLWrapper; diff --git a/src/deps/uws/WindowsNamedPipe.zig b/src/deps/uws/WindowsNamedPipe.zig index fdf216dbcd..904c4be907 100644 --- a/src/deps/uws/WindowsNamedPipe.zig +++ b/src/deps/uws/WindowsNamedPipe.zig @@ -573,7 +573,7 @@ pub fn deinit(this: *WindowsNamedPipe) void { pub const CertError = UpgradedDuplex.CertError; const WrapperType = SSLWrapper(*WindowsNamedPipe); -const log = bun.Output.scoped(.WindowsNamedPipe, false); +const log = bun.Output.scoped(.WindowsNamedPipe, .visible); const std = @import("std"); const SSLWrapper = @import("../../bun.js/api/bun/ssl_wrapper.zig").SSLWrapper; diff --git a/src/deps/uws/socket.zig b/src/deps/uws/socket.zig index 1785f103e5..6e7b3551e3 100644 --- a/src/deps/uws/socket.zig +++ b/src/deps/uws/socket.zig @@ -1211,7 +1211,7 @@ const c = struct { pub extern fn us_socket_wrap_with_tls(ssl: i32, s: *uws.us_socket_t, options: uws.SocketContext.BunSocketContextOptions, events: c.us_socket_events_t, socket_ext_size: i32) ?*uws.us_socket_t; }; -const debug = bun.Output.scoped(.uws, false); +const debug = bun.Output.scoped(.uws, .visible); const std = @import("std"); diff --git a/src/deps/uws/us_socket_t.zig b/src/deps/uws/us_socket_t.zig index e418785c74..bd84853b52 100644 --- a/src/deps/uws/us_socket_t.zig +++ b/src/deps/uws/us_socket_t.zig @@ -1,4 +1,4 @@ -const debug = bun.Output.scoped(.uws, false); +const debug = bun.Output.scoped(.uws, .visible); const max_i32 = std.math.maxInt(i32); /// Zig bindings for `us_socket_t` diff --git a/src/fs.zig b/src/fs.zig index 7968cde64e..581291bf00 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -1,6 +1,6 @@ const Fs = @This(); -pub const debug = Output.scoped(.fs, true); +pub const debug = Output.scoped(.fs, .hidden); // pub const FilesystemImplementation = @import("./fs_impl.zig"); diff --git a/src/glob/GlobWalker.zig b/src/glob/GlobWalker.zig index 1010c75444..566909f9bf 100644 --- a/src/glob/GlobWalker.zig +++ b/src/glob/GlobWalker.zig @@ -25,7 +25,7 @@ const isWindows = @import("builtin").os.tag == .windows; // const Codepoint = u32; -const log = bun.Output.scoped(.Glob, false); +const log = bun.Output.scoped(.Glob, .visible); const CursorState = struct { cursor: CodepointIterator.Cursor = .{}, diff --git a/src/http.zig b/src/http.zig index d5389563b1..07e9ddc428 100644 --- a/src/http.zig +++ b/src/http.zig @@ -27,7 +27,7 @@ var shared_response_headers_buf: [256]picohttp.Header = undefined; pub const end_of_chunked_http1_1_encoding_response_body = "0\r\n\r\n"; -const log = Output.scoped(.fetch, false); +const log = Output.scoped(.fetch, .visible); pub var temp_hostname: [8192]u8 = undefined; diff --git a/src/http/AsyncHTTP.zig b/src/http/AsyncHTTP.zig index defb87a76d..3a41a67663 100644 --- a/src/http/AsyncHTTP.zig +++ b/src/http/AsyncHTTP.zig @@ -468,7 +468,7 @@ pub fn onStart(this: *AsyncHTTP) void { this.client.start(this.request_body, this.response_buffer); } -const log = bun.Output.scoped(.AsyncHTTP, false); +const log = bun.Output.scoped(.AsyncHTTP, .visible); const HTTPCallbackPair = .{ *AsyncHTTP, HTTPClientResult }; pub const HTTPChannel = Channel(HTTPCallbackPair, .{ .Static = 1000 }); diff --git a/src/http/HTTPContext.zig b/src/http/HTTPContext.zig index 62c83f90d5..bc36f9abef 100644 --- a/src/http/HTTPContext.zig +++ b/src/http/HTTPContext.zig @@ -491,7 +491,7 @@ pub fn NewHTTPContext(comptime ssl: bool) type { const DeadSocket = opaque {}; var dead_socket = @as(*DeadSocket, @ptrFromInt(1)); -const log = bun.Output.scoped(.HTTPContext, true); +const log = bun.Output.scoped(.HTTPContext, .hidden); const HTTPCertError = @import("./HTTPCertError.zig"); const HTTPThread = @import("./HTTPThread.zig"); diff --git a/src/http/HTTPThread.zig b/src/http/HTTPThread.zig index 28c1a6e847..90ba1c31f5 100644 --- a/src/http/HTTPThread.zig +++ b/src/http/HTTPThread.zig @@ -79,7 +79,7 @@ pub const RequestBodyBuffer = union(enum) { } }; -const threadlog = Output.scoped(.HTTPThread, true); +const threadlog = Output.scoped(.HTTPThread, .hidden); const WriteMessage = struct { async_http_id: u32, flags: packed struct(u8) { @@ -460,7 +460,7 @@ pub fn schedule(this: *@This(), batch: Batch) void { pub const Queue = UnboundedQueue(AsyncHTTP, .next); -const log = Output.scoped(.HTTPThread, false); +const log = Output.scoped(.HTTPThread, .visible); const stringZ = [:0]const u8; diff --git a/src/http/InternalState.zig b/src/http/InternalState.zig index a3c8c26a95..dab63e9053 100644 --- a/src/http/InternalState.zig +++ b/src/http/InternalState.zig @@ -217,7 +217,7 @@ pub fn processBodyBuffer(this: *InternalState, buffer: MutableString, is_final_c return this.body_out_str.?.list.items.len > 0; } -const log = Output.scoped(.HTTPInternalState, true); +const log = Output.scoped(.HTTPInternalState, .hidden); const HTTPStage = enum { pending, diff --git a/src/http/ProxyTunnel.zig b/src/http/ProxyTunnel.zig index 0f64ad5642..bf980343b4 100644 --- a/src/http/ProxyTunnel.zig +++ b/src/http/ProxyTunnel.zig @@ -334,7 +334,7 @@ fn deinit(this: *ProxyTunnel) void { bun.destroy(this); } -const log = bun.Output.scoped(.http_proxy_tunnel, false); +const log = bun.Output.scoped(.http_proxy_tunnel, .visible); const HTTPCertError = @import("./HTTPCertError.zig"); const SSLWrapper = @import("../bun.js/api/bun/ssl_wrapper.zig").SSLWrapper; diff --git a/src/http/websocket_client.zig b/src/http/websocket_client.zig index e6ef2d8f37..bb26ec8b87 100644 --- a/src/http/websocket_client.zig +++ b/src/http/websocket_client.zig @@ -1554,7 +1554,7 @@ const Copy = union(enum) { } }; -const log = Output.scoped(.WebSocketClient, false); +const log = Output.scoped(.WebSocketClient, .visible); const string = []const u8; diff --git a/src/http/websocket_client/WebSocketUpgradeClient.zig b/src/http/websocket_client/WebSocketUpgradeClient.zig index b02c51ecef..91e33c505b 100644 --- a/src/http/websocket_client/WebSocketUpgradeClient.zig +++ b/src/http/websocket_client/WebSocketUpgradeClient.zig @@ -675,7 +675,7 @@ fn buildRequestBody( ); } -const log = Output.scoped(.WebSocketUpgradeClient, false); +const log = Output.scoped(.WebSocketUpgradeClient, .visible); const WebSocketDeflate = @import("./WebSocketDeflate.zig"); const std = @import("std"); diff --git a/src/install/PackageInstall.zig b/src/install/PackageInstall.zig index ac04867665..b60c23cde4 100644 --- a/src/install/PackageInstall.zig +++ b/src/install/PackageInstall.zig @@ -25,7 +25,7 @@ pub const PackageInstall = struct { contents_hash: u64, }; - const debug = Output.scoped(.install, true); + const debug = Output.scoped(.install, .hidden); pub const Summary = struct { fail: u32 = 0, diff --git a/src/install/PackageInstaller.zig b/src/install/PackageInstaller.zig index 235b7af82b..e6a3e6076c 100644 --- a/src/install/PackageInstaller.zig +++ b/src/install/PackageInstaller.zig @@ -45,7 +45,7 @@ pub const PackageInstaller = struct { seen_bin_links: bun.StringHashMap(void), - const debug = Output.scoped(.PackageInstaller, true); + const debug = Output.scoped(.PackageInstaller, .hidden); pub const NodeModulesFolder = struct { tree_id: Lockfile.Tree.Id = 0, diff --git a/src/install/PackageManager.zig b/src/install/PackageManager.zig index eab0caf21f..f9055beb8f 100644 --- a/src/install/PackageManager.zig +++ b/src/install/PackageManager.zig @@ -445,7 +445,7 @@ pub fn get() *PackageManager { pub const SuccessFn = *const fn (*PackageManager, DependencyID, PackageID) void; pub const FailFn = *const fn (*PackageManager, *const Dependency, PackageID, anyerror) void; -pub const debug = Output.scoped(.PackageManager, true); +pub const debug = Output.scoped(.PackageManager, .hidden); pub fn ensureTempNodeGypScript(this: *PackageManager) !void { return ensureTempNodeGypScriptOnce.call(.{this}); diff --git a/src/install/isolated_install.zig b/src/install/isolated_install.zig index 45b8707ac9..2782428232 100644 --- a/src/install/isolated_install.zig +++ b/src/install/isolated_install.zig @@ -1,4 +1,4 @@ -const log = Output.scoped(.IsolatedInstall, false); +const log = Output.scoped(.IsolatedInstall, .visible); /// Runs on main thread pub fn installIsolatedPackages( diff --git a/src/install/isolated_install/Store.zig b/src/install/isolated_install/Store.zig index 9c044e5647..a1486baf49 100644 --- a/src/install/isolated_install/Store.zig +++ b/src/install/isolated_install/Store.zig @@ -8,7 +8,7 @@ pub const Store = struct { entries: Entry.List, nodes: Node.List, - const log = Output.scoped(.Store, false); + const log = Output.scoped(.Store, .visible); pub const modules_dir_name = ".bun"; diff --git a/src/install/lifecycle_script_runner.zig b/src/install/lifecycle_script_runner.zig index 3fb5bb43b7..38faa13d80 100644 --- a/src/install/lifecycle_script_runner.zig +++ b/src/install/lifecycle_script_runner.zig @@ -1,4 +1,4 @@ -const log = Output.scoped(.Script, false); +const log = Output.scoped(.Script, .visible); pub const LifecycleScriptSubprocess = struct { package_name: string, diff --git a/src/install/lockfile/OverrideMap.zig b/src/install/lockfile/OverrideMap.zig index 2643f58740..b6e509bbc6 100644 --- a/src/install/lockfile/OverrideMap.zig +++ b/src/install/lockfile/OverrideMap.zig @@ -1,6 +1,6 @@ const OverrideMap = @This(); -const debug = Output.scoped(.OverrideMap, false); +const debug = Output.scoped(.OverrideMap, .visible); map: std.ArrayHashMapUnmanaged(PackageNameHash, Dependency, ArrayIdentityContext.U64, false) = .{}, diff --git a/src/install/lockfile/Package.zig b/src/install/lockfile/Package.zig index a96b51c86f..8fa52504d3 100644 --- a/src/install/lockfile/Package.zig +++ b/src/install/lockfile/Package.zig @@ -70,7 +70,7 @@ pub const Package = extern struct { } }; - const debug = Output.scoped(.Lockfile, true); + const debug = Output.scoped(.Lockfile, .hidden); pub fn clone( this: *const Package, diff --git a/src/install/lockfile/Package/Scripts.zig b/src/install/lockfile/Package/Scripts.zig index b330324fb7..df0a18f72c 100644 --- a/src/install/lockfile/Package/Scripts.zig +++ b/src/install/lockfile/Package/Scripts.zig @@ -357,7 +357,7 @@ pub const Scripts = extern struct { const string = []const u8; const stringZ = [:0]const u8; -const debug = Output.scoped(.Lockfile, true); +const debug = Output.scoped(.Lockfile, .hidden); const std = @import("std"); const Allocator = std.mem.Allocator; diff --git a/src/install/lockfile/Package/WorkspaceMap.zig b/src/install/lockfile/Package/WorkspaceMap.zig index d6406f4986..f43b0dc4f3 100644 --- a/src/install/lockfile/Package/WorkspaceMap.zig +++ b/src/install/lockfile/Package/WorkspaceMap.zig @@ -378,7 +378,7 @@ fn ignoredWorkspacePaths(path: []const u8) bool { const GlobWalker = Glob.GlobWalker(ignoredWorkspacePaths, Glob.walk.SyscallAccessor, false); const string = []const u8; -const debug = Output.scoped(.Lockfile, true); +const debug = Output.scoped(.Lockfile, .hidden); const stringZ = [:0]const u8; const std = @import("std"); diff --git a/src/install/migration.zig b/src/install/migration.zig index c7b68937eb..6365245703 100644 --- a/src/install/migration.zig +++ b/src/install/migration.zig @@ -1,4 +1,4 @@ -const debug = Output.scoped(.migrate, false); +const debug = Output.scoped(.migrate, .visible); pub fn detectAndLoadOtherLockfile( this: *Lockfile, diff --git a/src/install/patch_install.zig b/src/install/patch_install.zig index cbd11f56b8..ca27a6fb6f 100644 --- a/src/install/patch_install.zig +++ b/src/install/patch_install.zig @@ -30,7 +30,7 @@ pub const PatchTask = struct { pre: bool = false, next: ?*PatchTask = null, - const debug = bun.Output.scoped(.InstallPatch, false); + const debug = bun.Output.scoped(.InstallPatch, .visible); const Maybe = bun.sys.Maybe; diff --git a/src/install/windows-shim/bun_shim_impl.zig b/src/install/windows-shim/bun_shim_impl.zig index 7cba0f8276..a5e5771310 100644 --- a/src/install/windows-shim/bun_shim_impl.zig +++ b/src/install/windows-shim/bun_shim_impl.zig @@ -42,7 +42,7 @@ const dbg = builtin.mode == .Debug; const is_standalone = @import("root") == @This(); const bun = if (!is_standalone) @import("bun") else @compileError("cannot use 'bun' in standalone build of bun_shim_impl"); -const bunDebugMessage = bun.Output.scoped(.bun_shim_impl, true); +const bunDebugMessage = bun.Output.scoped(.bun_shim_impl, .hidden); const callmod_inline = if (is_standalone) std.builtin.CallModifier.always_inline else bun.callmod_inline; /// A copy of all ntdll declarations this program uses diff --git a/src/io/PipeWriter.zig b/src/io/PipeWriter.zig index 44cf21b316..7511b5bb85 100644 --- a/src/io/PipeWriter.zig +++ b/src/io/PipeWriter.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.PipeWriter, true); +const log = bun.Output.scoped(.PipeWriter, .hidden); pub const WriteResult = union(enum) { done: usize, diff --git a/src/io/io.zig b/src/io/io.zig index 012e7d6a7a..a24a1499cc 100644 --- a/src/io/io.zig +++ b/src/io/io.zig @@ -8,7 +8,7 @@ pub const heap = @import("./heap.zig"); pub const openForWriting = @import("./openForWriting.zig").openForWriting; pub const openForWritingImpl = @import("./openForWriting.zig").openForWritingImpl; -const log = bun.Output.scoped(.loop, false); +const log = bun.Output.scoped(.loop, .visible); pub const Source = @import("./source.zig").Source; diff --git a/src/io/source.zig b/src/io/source.zig index 2028cdfa6a..5f7e7b2250 100644 --- a/src/io/source.zig +++ b/src/io/source.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.PipeSource, true); +const log = bun.Output.scoped(.PipeSource, .hidden); pub const Source = union(enum) { pipe: *Pipe, diff --git a/src/napi/napi.zig b/src/napi/napi.zig index 2181cc94dd..6ec7905ae0 100644 --- a/src/napi/napi.zig +++ b/src/napi/napi.zig @@ -1,6 +1,6 @@ const TODO_EXCEPTION: jsc.C.ExceptionRef = null; -const log = bun.Output.scoped(.napi, false); +const log = bun.Output.scoped(.napi, .visible); /// This is `struct napi_env__` from napi.h pub const NapiEnv = opaque { diff --git a/src/output.zig b/src/output.zig index 30d8ac3f3e..eb9e7d401e 100644 --- a/src/output.zig +++ b/src/output.zig @@ -741,7 +741,19 @@ pub noinline fn print(comptime fmt: string, args: anytype) callconv(std.builtin. /// BUN_DEBUG_ALL=1 pub const LogFunction = fn (comptime fmt: string, args: anytype) callconv(bun.callconv_inline) void; -pub fn Scoped(comptime tag: anytype, comptime disabled: bool) type { +pub const Visibility = enum { + /// Hide logs for this scope by default. + hidden, + /// Show logs for this scope by default. + visible, + + /// Show logs for this scope by default if and only if `condition` is true. + pub fn visibleIf(condition: bool) Visibility { + return if (condition) .visible else .hidden; + } +}; + +pub fn Scoped(comptime tag: anytype, comptime visibility: Visibility) type { const tagname = comptime if (!Environment.enable_logs) .{} else brk: { const input = switch (@TypeOf(tag)) { @Type(.enum_literal) => @tagName(tag), @@ -754,10 +766,10 @@ pub fn Scoped(comptime tag: anytype, comptime disabled: bool) type { break :brk ascii_slice; }; - return ScopedLogger(&tagname, disabled); + return ScopedLogger(&tagname, visibility); } -fn ScopedLogger(comptime tagname: []const u8, comptime disabled: bool) type { +fn ScopedLogger(comptime tagname: []const u8, comptime visibility: Visibility) type { if (comptime !Environment.enable_logs) { return struct { pub inline fn isVisible() bool { @@ -773,7 +785,7 @@ fn ScopedLogger(comptime tagname: []const u8, comptime disabled: bool) type { var buffered_writer: BufferedWriter = undefined; var out: BufferedWriter.Writer = undefined; var out_set = false; - var really_disable = std.atomic.Value(bool).init(disabled); + var really_disable = std.atomic.Value(bool).init(visibility == .hidden); var lock = bun.Mutex{}; @@ -865,11 +877,8 @@ fn ScopedLogger(comptime tagname: []const u8, comptime disabled: bool) type { }; } -pub fn scoped(comptime tag: anytype, comptime disabled: bool) LogFunction { - return Scoped( - tag, - disabled, - ).log; +pub fn scoped(comptime tag: anytype, comptime visibility: Visibility) LogFunction { + return Scoped(tag, visibility).log; } pub fn up(n: usize) void { diff --git a/src/patch.zig b/src/patch.zig index 7979077d42..9cb700395a 100644 --- a/src/patch.zig +++ b/src/patch.zig @@ -3,7 +3,7 @@ const WHITESPACE: []const u8 = " \t\n\r"; // TODO: calculate this for different systems const PAGE_SIZE = 16384; -const debug = bun.Output.scoped(.patch, false); +const debug = bun.Output.scoped(.patch, .visible); /// All strings point to the original patch file text pub const PatchFilePart = union(enum) { diff --git a/src/paths/Path.zig b/src/paths/Path.zig index 40703404a4..2eb2e06caf 100644 --- a/src/paths/Path.zig +++ b/src/paths/Path.zig @@ -240,7 +240,7 @@ pub fn Path(comptime opts: Options) type { // @compileError("utf16 not supported"); // } - // const log = Output.scoped(.Path, false); + // const log = Output.scoped(.Path, .visible); return struct { _buf: opts.Buf(), diff --git a/src/ptr/ref_count.zig b/src/ptr/ref_count.zig index 2d20dc633b..9c38f5a27c 100644 --- a/src/ptr/ref_count.zig +++ b/src/ptr/ref_count.zig @@ -71,7 +71,7 @@ pub fn RefCount(T: type, field_name: []const u8, destructor: anytype, options: O debug: if (enable_debug) DebugData(false) else void = if (enable_debug) .empty, const debug_name = options.debug_name orelse bun.meta.typeBaseName(@typeName(T)); - pub const scope = bun.Output.Scoped(debug_name, true); + pub const scope = bun.Output.Scoped(debug_name, .hidden); const debug_stack_trace = false; const Destructor = if (options.destructor_ctx) |ctx| fn (*T, ctx) void else fn (*T) void; @@ -208,7 +208,7 @@ pub fn ThreadSafeRefCount(T: type, field_name: []const u8, destructor: fn (*T) v debug: if (enable_debug) DebugData(true) else void = if (enable_debug) .empty, const debug_name = options.debug_name orelse bun.meta.typeBaseName(@typeName(T)); - pub const scope = bun.Output.Scoped(debug_name, true); + pub const scope = bun.Output.Scoped(debug_name, .hidden); pub fn init() @This() { return .initExactRefs(1); diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig index 3e04e7f300..cfa902c835 100644 --- a/src/resolver/resolver.zig +++ b/src/resolver/resolver.zig @@ -1,7 +1,7 @@ pub const DataURL = @import("./data_url.zig").DataURL; pub const DirInfo = @import("./dir_info.zig"); -const debuglog = Output.scoped(.Resolver, true); +const debuglog = Output.scoped(.Resolver, .hidden); pub fn isPackagePath(path: string) bool { // Always check for posix absolute paths (starts with "/") @@ -1602,7 +1602,7 @@ pub const Resolver = struct { } } - const dev = Output.scoped(.Resolver, false); + const dev = Output.scoped(.Resolver, .visible); /// Directory cache keys must follow the following rules. If the rules are broken, /// then there will be conflicting cache entries, and trying to bust the cache may not work. diff --git a/src/s3/client.zig b/src/s3/client.zig index 5194fdf2bd..c41b6ae126 100644 --- a/src/s3/client.zig +++ b/src/s3/client.zig @@ -326,7 +326,7 @@ pub const S3UploadStreamWrapper = struct { pub const ref = RefCount.ref; pub const deref = RefCount.deref; pub const ResumableSink = @import("../bun.js/webcore/ResumableSink.zig").ResumableS3UploadSink; - const log = bun.Output.scoped(.S3UploadStream, false); + const log = bun.Output.scoped(.S3UploadStream, .visible); ref_count: RefCount, diff --git a/src/s3/credentials.zig b/src/s3/credentials.zig index b0e0053c0e..dbd0148698 100644 --- a/src/s3/credentials.zig +++ b/src/s3/credentials.zig @@ -275,7 +275,7 @@ pub const S3Credentials = struct { bun.destroy(this); } - const log = bun.Output.scoped(.AWS, false); + const log = bun.Output.scoped(.AWS, .visible); const DateResult = struct { // numeric representation of year, month and day (excluding time components) diff --git a/src/s3/download_stream.zig b/src/s3/download_stream.zig index d743eee668..89a75a0d7e 100644 --- a/src/s3/download_stream.zig +++ b/src/s3/download_stream.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.S3, true); +const log = bun.Output.scoped(.S3, .hidden); pub const S3HttpDownloadStreamingTask = struct { pub const new = bun.TrivialNew(@This()); diff --git a/src/s3/multipart.zig b/src/s3/multipart.zig index a16daa2a7f..f47e9d31bc 100644 --- a/src/s3/multipart.zig +++ b/src/s3/multipart.zig @@ -139,7 +139,7 @@ pub const MultiPartUpload = struct { pub const ref = RefCount.ref; pub const deref = RefCount.deref; - const log = bun.Output.scoped(.S3MultiPartUpload, true); + const log = bun.Output.scoped(.S3MultiPartUpload, .hidden); pub const UploadPart = struct { data: []const u8, diff --git a/src/shell/EnvStr.zig b/src/shell/EnvStr.zig index cd2de167bc..cc613d4c0a 100644 --- a/src/shell/EnvStr.zig +++ b/src/shell/EnvStr.zig @@ -11,7 +11,7 @@ pub const EnvStr = packed struct(u128) { tag: Tag = .empty, len: usize = 0, - const debug = bun.Output.scoped(.EnvStr, true); + const debug = bun.Output.scoped(.EnvStr, .hidden); const Tag = enum(u16) { /// no value diff --git a/src/shell/IOWriter.zig b/src/shell/IOWriter.zig index ae84740bb5..43f14e8843 100644 --- a/src/shell/IOWriter.zig +++ b/src/shell/IOWriter.zig @@ -37,7 +37,7 @@ async_deinit: AsyncDeinitWriter = .{}, started: bool = false, flags: Flags = .{}, -const debug = bun.Output.scoped(.IOWriter, true); +const debug = bun.Output.scoped(.IOWriter, .hidden); pub const ChildPtr = IOWriterChildPtr; @@ -835,7 +835,7 @@ pub const AsyncDeinitWriter = struct { } }; -const log = bun.Output.scoped(.IOWriter, true); +const log = bun.Output.scoped(.IOWriter, .hidden); const std = @import("std"); diff --git a/src/shell/RefCountedStr.zig b/src/shell/RefCountedStr.zig index e79b5cbd92..26601c232d 100644 --- a/src/shell/RefCountedStr.zig +++ b/src/shell/RefCountedStr.zig @@ -4,7 +4,7 @@ refcount: u32 = 1, len: u32 = 0, ptr: [*]const u8 = undefined, -const debug = bun.Output.scoped(.RefCountedEnvStr, true); +const debug = bun.Output.scoped(.RefCountedEnvStr, .hidden); pub fn init(slice: []const u8) *RefCountedStr { debug("init: {s}", .{slice}); diff --git a/src/shell/braces.zig b/src/shell/braces.zig index 66330ef1cc..60e96d7db3 100644 --- a/src/shell/braces.zig +++ b/src/shell/braces.zig @@ -1,4 +1,4 @@ -const log = bun.Output.scoped(.BRACES, false); +const log = bun.Output.scoped(.BRACES, .visible); /// Using u16 because anymore tokens than that results in an unreasonably high /// amount of brace expansion (like around 32k variants to expand) diff --git a/src/shell/builtin/cat.zig b/src/shell/builtin/cat.zig index 39c2d80223..10e3d78566 100644 --- a/src/shell/builtin/cat.zig +++ b/src/shell/builtin/cat.zig @@ -331,7 +331,7 @@ const Opts = struct { } }; -const debug = bun.Output.scoped(.ShellCat, true); +const debug = bun.Output.scoped(.ShellCat, .hidden); const std = @import("std"); diff --git a/src/shell/builtin/cd.zig b/src/shell/builtin/cd.zig index c4cbe1a31b..1fd92d7bc6 100644 --- a/src/shell/builtin/cd.zig +++ b/src/shell/builtin/cd.zig @@ -116,7 +116,7 @@ pub fn deinit(this: *Cd) void { } // -- -const log = bun.Output.scoped(.Cd, true); +const log = bun.Output.scoped(.Cd, .hidden); const interpreter = @import("../interpreter.zig"); const std = @import("std"); diff --git a/src/shell/builtin/cp.zig b/src/shell/builtin/cp.zig index 6bb2b2e869..2a0ef9830c 100644 --- a/src/shell/builtin/cp.zig +++ b/src/shell/builtin/cp.zig @@ -313,7 +313,7 @@ pub const ShellCpTask = struct { concurrent_task: jsc.EventLoopTask, err: ?bun.shell.ShellErr = null, - const debug = bun.Output.scoped(.ShellCpTask, false); + const debug = bun.Output.scoped(.ShellCpTask, .visible); fn deinit(this: *ShellCpTask) void { debug("deinit", .{}); @@ -729,7 +729,7 @@ const Opts = packed struct(u16) { }; // -- -const log = bun.Output.scoped(.cp, true); +const log = bun.Output.scoped(.cp, .hidden); const interpreter = @import("../interpreter.zig"); const FlagParser = interpreter.FlagParser; diff --git a/src/shell/builtin/echo.zig b/src/shell/builtin/echo.zig index e2d7ac6af3..2935c7d098 100644 --- a/src/shell/builtin/echo.zig +++ b/src/shell/builtin/echo.zig @@ -68,7 +68,7 @@ pub inline fn bltn(this: *Echo) *Builtin { return @fieldParentPtr("impl", impl); } -const log = bun.Output.scoped(.echo, true); +const log = bun.Output.scoped(.echo, .hidden); const interpreter = @import("../interpreter.zig"); const std = @import("std"); diff --git a/src/shell/builtin/export.zig b/src/shell/builtin/export.zig index 30f64728ca..f1678e451e 100644 --- a/src/shell/builtin/export.zig +++ b/src/shell/builtin/export.zig @@ -123,7 +123,7 @@ pub inline fn bltn(this: *Export) *Builtin { } // -- -const debug = bun.Output.scoped(.ShellExport, true); +const debug = bun.Output.scoped(.ShellExport, .hidden); const log = debug; const std = @import("std"); diff --git a/src/shell/builtin/ls.zig b/src/shell/builtin/ls.zig index db29e13941..14f143fa36 100644 --- a/src/shell/builtin/ls.zig +++ b/src/shell/builtin/ls.zig @@ -211,7 +211,7 @@ const ShellLsOutputTaskVTable = struct { }; pub const ShellLsTask = struct { - const debug = bun.Output.scoped(.ShellLsTask, true); + const debug = bun.Output.scoped(.ShellLsTask, .hidden); ls: *Ls, opts: Opts, @@ -848,7 +848,7 @@ pub inline fn bltn(this: *Ls) *Builtin { return @fieldParentPtr("impl", impl); } -const log = bun.Output.scoped(.ls, true); +const log = bun.Output.scoped(.ls, .hidden); const std = @import("std"); const Allocator = std.mem.Allocator; diff --git a/src/shell/builtin/mkdir.zig b/src/shell/builtin/mkdir.zig index 91f8ae1f10..f52a438fd6 100644 --- a/src/shell/builtin/mkdir.zig +++ b/src/shell/builtin/mkdir.zig @@ -372,7 +372,7 @@ pub inline fn bltn(this: *Mkdir) *Builtin { } // -- -const debug = bun.Output.scoped(.ShellMkdir, true); +const debug = bun.Output.scoped(.ShellMkdir, .hidden); const log = debug; diff --git a/src/shell/builtin/mv.zig b/src/shell/builtin/mv.zig index b25ed04971..1440ff74de 100644 --- a/src/shell/builtin/mv.zig +++ b/src/shell/builtin/mv.zig @@ -485,7 +485,7 @@ pub inline fn bltn(this: *Mv) *Builtin { } // -- -const debug = bun.Output.scoped(.ShellCat, true); +const debug = bun.Output.scoped(.ShellCat, .hidden); const std = @import("std"); diff --git a/src/shell/builtin/rm.zig b/src/shell/builtin/rm.zig index 380ad0e3e9..5f5dc33f09 100644 --- a/src/shell/builtin/rm.zig +++ b/src/shell/builtin/rm.zig @@ -450,7 +450,7 @@ fn writeVerbose(this: *Rm, verbose: *ShellRmTask.DirTask) Yield { } pub const ShellRmTask = struct { - const debug = bun.Output.scoped(.AsyncRmTask, true); + const debug = bun.Output.scoped(.AsyncRmTask, .hidden); rm: *Rm, opts: Opts, @@ -1196,7 +1196,7 @@ pub fn writeFailingError(this: *Rm, buf: []const u8, exit_code: ExitCode) Yield return this.bltn().done(exit_code); } -const log = bun.Output.scoped(.Rm, true); +const log = bun.Output.scoped(.Rm, .hidden); const builtin = @import("builtin"); const std = @import("std"); diff --git a/src/shell/builtin/touch.zig b/src/shell/builtin/touch.zig index 50ac67a410..6e88e9ba27 100644 --- a/src/shell/builtin/touch.zig +++ b/src/shell/builtin/touch.zig @@ -387,7 +387,7 @@ pub inline fn bltn(this: *Touch) *Builtin { } // -- -const debug = bun.Output.scoped(.ShellTouch, true); +const debug = bun.Output.scoped(.ShellTouch, .hidden); const log = debug; const std = @import("std"); diff --git a/src/shell/builtin/which.zig b/src/shell/builtin/which.zig index 9e812e8aeb..89b6997554 100644 --- a/src/shell/builtin/which.zig +++ b/src/shell/builtin/which.zig @@ -136,7 +136,7 @@ pub inline fn bltn(this: *Which) *Builtin { } // -- -const log = bun.Output.scoped(.which, true); +const log = bun.Output.scoped(.which, .hidden); const std = @import("std"); diff --git a/src/shell/interpreter.zig b/src/shell/interpreter.zig index 92e0a322a2..1797b6dcaa 100644 --- a/src/shell/interpreter.zig +++ b/src/shell/interpreter.zig @@ -80,7 +80,7 @@ pub fn OOM(e: anyerror) noreturn { bun.outOfMemory(); } -pub const log = bun.Output.scoped(.SHELL, false); +pub const log = bun.Output.scoped(.SHELL, .visible); /// This is a zero-sized type returned by `.needsIO()`, designed to ensure /// functions which rely on IO are not called when they do don't need it. @@ -140,7 +140,7 @@ pub const CowFd = struct { refcount: u32 = 1, being_used: bool = false, - const debug = bun.Output.scoped(.CowFd, true); + const debug = bun.Output.scoped(.CowFd, .hidden); pub fn init(fd: bun.FileDescriptor) *CowFd { const this = bun.default_allocator.create(CowFd) catch bun.outOfMemory(); @@ -742,7 +742,7 @@ pub const Interpreter = struct { } if (comptime bun.Environment.allow_assert) { - const debug = bun.Output.scoped(.ShellTokens, true); + const debug = bun.Output.scoped(.ShellTokens, .hidden); var test_tokens = std.ArrayList(shell.Test.TestToken).initCapacity(arena_allocator, lex_result.tokens.len) catch @panic("OOPS"); defer test_tokens.deinit(); for (lex_result.tokens) |tok| { diff --git a/src/shell/shell.zig b/src/shell/shell.zig index 0565472755..df44e87a4f 100644 --- a/src/shell/shell.zig +++ b/src/shell/shell.zig @@ -154,7 +154,7 @@ fn setEnv(name: [*:0]const u8, value: [*:0]const u8) void { /// [1] => write end pub const Pipe = [2]bun.FileDescriptor; -const log = bun.Output.scoped(.SHELL, true); +const log = bun.Output.scoped(.SHELL, .hidden); pub const GlobalJS = struct { globalThis: *jsc.JSGlobalObject, diff --git a/src/shell/states/Expansion.zig b/src/shell/states/Expansion.zig index 117a9d9ace..876dfef8a2 100644 --- a/src/shell/states/Expansion.zig +++ b/src/shell/states/Expansion.zig @@ -737,7 +737,7 @@ fn outEnsureUnusedCapacity(this: *Expansion, additional: usize) void { } pub const ShellGlobTask = struct { - const debug = bun.Output.scoped(.ShellGlobTask, true); + const debug = bun.Output.scoped(.ShellGlobTask, .hidden); task: WorkPoolTask = .{ .callback = &runFromThreadPool }, diff --git a/src/shell/subproc.zig b/src/shell/subproc.zig index 63ee632662..7aaa16c52c 100644 --- a/src/shell/subproc.zig +++ b/src/shell/subproc.zig @@ -25,7 +25,7 @@ pub const ShellIO = struct { /// TODO Set this to interpreter const ShellCmd = bun.shell.Interpreter.Cmd; -const log = Output.scoped(.SHELL_SUBPROC, false); +const log = Output.scoped(.SHELL_SUBPROC, .visible); pub const ShellSubprocess = struct { const Subprocess = @This(); diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig index 1b2b67483e..d79452384d 100644 --- a/src/sourcemap/sourcemap.zig +++ b/src/sourcemap/sourcemap.zig @@ -1,5 +1,5 @@ pub const SourceMap = @This(); -const debug = bun.Output.scoped(.SourceMap, false); +const debug = bun.Output.scoped(.SourceMap, .visible); /// Coordinates in source maps are stored using relative offsets for size /// reasons. When joining together chunks of a source map that were emitted diff --git a/src/sql/postgres/CommandTag.zig b/src/sql/postgres/CommandTag.zig index 579cab853b..47f70048c2 100644 --- a/src/sql/postgres/CommandTag.zig +++ b/src/sql/postgres/CommandTag.zig @@ -96,7 +96,7 @@ pub const CommandTag = union(enum) { } }; -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const bun = @import("bun"); const std = @import("std"); diff --git a/src/sql/postgres/DataCell.zig b/src/sql/postgres/DataCell.zig index ecf1bce52c..e7e219e942 100644 --- a/src/sql/postgres/DataCell.zig +++ b/src/sql/postgres/DataCell.zig @@ -1101,7 +1101,7 @@ pub const DataCell = extern struct { }; }; -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const PostgresCachedStructure = @import("./PostgresCachedStructure.zig"); const protocol = @import("./PostgresProtocol.zig"); diff --git a/src/sql/postgres/DebugSocketMonitorReader.zig b/src/sql/postgres/DebugSocketMonitorReader.zig index ff57340c41..1af82ce043 100644 --- a/src/sql/postgres/DebugSocketMonitorReader.zig +++ b/src/sql/postgres/DebugSocketMonitorReader.zig @@ -17,7 +17,7 @@ pub fn write(data: []const u8) void { file.writeAll(data) catch {}; } -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const bun = @import("bun"); const std = @import("std"); diff --git a/src/sql/postgres/DebugSocketMonitorWriter.zig b/src/sql/postgres/DebugSocketMonitorWriter.zig index f16976d075..c721cdd2ac 100644 --- a/src/sql/postgres/DebugSocketMonitorWriter.zig +++ b/src/sql/postgres/DebugSocketMonitorWriter.zig @@ -17,7 +17,7 @@ pub fn load() void { } } -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const bun = @import("bun"); const std = @import("std"); diff --git a/src/sql/postgres/PostgresRequest.zig b/src/sql/postgres/PostgresRequest.zig index d12cc60b91..c302874e28 100644 --- a/src/sql/postgres/PostgresRequest.zig +++ b/src/sql/postgres/PostgresRequest.zig @@ -324,7 +324,7 @@ pub fn onData( pub const Queue = std.fifo.LinearFifo(*PostgresSQLQuery, .Dynamic); -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const PostgresSQLConnection = @import("./PostgresSQLConnection.zig"); const PostgresSQLQuery = @import("./PostgresSQLQuery.zig"); diff --git a/src/sql/postgres/PostgresSQLConnection.zig b/src/sql/postgres/PostgresSQLConnection.zig index 634c33aed0..fdf05b08ed 100644 --- a/src/sql/postgres/PostgresSQLConnection.zig +++ b/src/sql/postgres/PostgresSQLConnection.zig @@ -1800,7 +1800,7 @@ pub fn consumeOnCloseCallback(this: *const PostgresSQLConnection, globalObject: const PreparedStatementsMap = std.HashMapUnmanaged(u64, *PostgresSQLStatement, bun.IdentityContext(u64), 80); -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const MAX_PIPELINE_SIZE = std.math.maxInt(u16); // about 64KB per connection diff --git a/src/sql/postgres/PostgresSQLQuery.zig b/src/sql/postgres/PostgresSQLQuery.zig index 2fa6c66331..c8503c53f1 100644 --- a/src/sql/postgres/PostgresSQLQuery.zig +++ b/src/sql/postgres/PostgresSQLQuery.zig @@ -507,7 +507,7 @@ comptime { @export(&jscall, .{ .name = "PostgresSQLQuery__createInstance" }); } -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); pub const js = jsc.Codegen.JSPostgresSQLQuery; pub const fromJS = js.fromJS; diff --git a/src/sql/postgres/PostgresSQLStatement.zig b/src/sql/postgres/PostgresSQLStatement.zig index 644ea5800b..8e850c1bf8 100644 --- a/src/sql/postgres/PostgresSQLStatement.zig +++ b/src/sql/postgres/PostgresSQLStatement.zig @@ -159,7 +159,7 @@ pub fn structure(this: *PostgresSQLStatement, owner: JSValue, globalObject: *jsc return this.cached_structure; } -const debug = bun.Output.scoped(.Postgres, false); +const debug = bun.Output.scoped(.Postgres, .visible); const PostgresCachedStructure = @import("./PostgresCachedStructure.zig"); const Signature = @import("./Signature.zig"); diff --git a/src/sql/postgres/protocol/Authentication.zig b/src/sql/postgres/protocol/Authentication.zig index d6d89d9a6c..306e08b14d 100644 --- a/src/sql/postgres/protocol/Authentication.zig +++ b/src/sql/postgres/protocol/Authentication.zig @@ -171,7 +171,7 @@ pub const Authentication = union(enum) { pub const decode = DecoderWrap(Authentication, decodeInternal).decode; }; -const debug = bun.Output.scoped(.Postgres, true); +const debug = bun.Output.scoped(.Postgres, .hidden); const bun = @import("bun"); const std = @import("std"); diff --git a/src/string/immutable.zig b/src/string/immutable.zig index dcb79a9174..c96db67bf1 100644 --- a/src/string/immutable.zig +++ b/src/string/immutable.zig @@ -2344,7 +2344,7 @@ pub const withoutTrailingSlash = paths_.withoutTrailingSlash; pub const withoutTrailingSlashWindowsPath = paths_.withoutTrailingSlashWindowsPath; pub const basename = paths_.basename; -pub const log = bun.Output.scoped(.STR, true); +pub const log = bun.Output.scoped(.STR, .hidden); pub const grapheme = @import("./immutable/grapheme.zig"); pub const CodePoint = i32; diff --git a/src/sys.zig b/src/sys.zig index f58c40b70a..400588d39b 100644 --- a/src/sys.zig +++ b/src/sys.zig @@ -46,7 +46,7 @@ pub const X_OK = 1; pub const W_OK = 2; pub const R_OK = 4; -const log = bun.Output.scoped(.SYS, false); +const log = bun.Output.scoped(.SYS, .visible); pub const syslog = log; pub const syscall = switch (Environment.os) { diff --git a/src/url.zig b/src/url.zig index 9013b0864c..99523263e1 100644 --- a/src/url.zig +++ b/src/url.zig @@ -1,6 +1,6 @@ // This is close to WHATWG URL, but we don't want the validation errors pub const URL = struct { - const log = Output.scoped(.URL, false); + const log = Output.scoped(.URL, .visible); hash: string = "", /// hostname, but with a port @@ -875,7 +875,7 @@ pub const PercentEncoding = struct { pub const FormData = struct { fields: Map, buffer: []const u8, - const log = Output.scoped(.FormData, false); + const log = Output.scoped(.FormData, .visible); pub const Map = std.ArrayHashMapUnmanaged( bun.Semver.String, diff --git a/src/valkey/js_valkey.zig b/src/valkey/js_valkey.zig index 19fbb1b38a..27361c6a32 100644 --- a/src/valkey/js_valkey.zig +++ b/src/valkey/js_valkey.zig @@ -853,7 +853,7 @@ const Options = struct { } }; -const debug = bun.Output.scoped(.RedisJS, false); +const debug = bun.Output.scoped(.RedisJS, .visible); const Command = @import("./ValkeyCommand.zig"); const std = @import("std"); diff --git a/src/valkey/valkey.zig b/src/valkey/valkey.zig index 840fad0d66..efcb35f6a0 100644 --- a/src/valkey/valkey.zig +++ b/src/valkey/valkey.zig @@ -960,7 +960,7 @@ pub const ValkeyClient = struct { // Auto-pipelining -const debug = bun.Output.scoped(.Redis, false); +const debug = bun.Output.scoped(.Redis, .visible); const protocol = @import("./valkey_protocol.zig"); const std = @import("std"); diff --git a/src/watcher/INotifyWatcher.zig b/src/watcher/INotifyWatcher.zig index 65b634c566..d468d4f30b 100644 --- a/src/watcher/INotifyWatcher.zig +++ b/src/watcher/INotifyWatcher.zig @@ -3,7 +3,7 @@ const INotifyWatcher = @This(); -const log = Output.scoped(.watcher, false); +const log = Output.scoped(.watcher, .visible); // inotify events are variable-sized, so a byte buffer is used (also needed // since communication is done via the `read` syscall). what is notable about diff --git a/src/watcher/WindowsWatcher.zig b/src/watcher/WindowsWatcher.zig index 5b2267f7ac..3ee59eff56 100644 --- a/src/watcher/WindowsWatcher.zig +++ b/src/watcher/WindowsWatcher.zig @@ -309,7 +309,7 @@ pub fn createWatchEvent(event: FileEvent, index: WatchItemIndex) WatchEvent { }; } -const log = Output.scoped(.watcher, false); +const log = Output.scoped(.watcher, .visible); const std = @import("std"); const w = std.os.windows; diff --git a/src/which.zig b/src/which.zig index 5b893c619f..7382acb852 100644 --- a/src/which.zig +++ b/src/which.zig @@ -17,7 +17,7 @@ fn isValid(buf: *bun.PathBuffer, segment: []const u8, bin: []const u8) ?u16 { // Remember to resolve the symlink if necessary pub fn which(buf: *bun.PathBuffer, path: []const u8, cwd: []const u8, bin: []const u8) ?[:0]const u8 { if (bin.len > bun.MAX_PATH_BYTES) return null; - bun.Output.scoped(.which, true)("path={s} cwd={s} bin={s}", .{ path, cwd, bin }); + bun.Output.scoped(.which, .hidden)("path={s} cwd={s} bin={s}", .{ path, cwd, bin }); if (bun.Environment.os == .windows) { const convert_buf = bun.w_path_buffer_pool.get(); diff --git a/src/windows.zig b/src/windows.zig index 9ccaff0bb3..58c3af773e 100644 --- a/src/windows.zig +++ b/src/windows.zig @@ -3274,7 +3274,7 @@ pub fn userUniqueId() u32 { return 0; } const name = buf[0..size]; - bun.Output.scoped(.windowsUserUniqueId, false)("username: {}", .{bun.fmt.utf16(name)}); + bun.Output.scoped(.windowsUserUniqueId, .visible)("username: {}", .{bun.fmt.utf16(name)}); return bun.hash32(std.mem.sliceAsBytes(name)); }