From e7d5a97f81f679509881fa89878ac5584f4c447b Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sat, 13 Jan 2024 00:00:17 -0600 Subject: [PATCH] remove debug logging --- src/connect.zig | 26 +++++++++++++------------- src/main.zig | 16 ---------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/connect.zig b/src/connect.zig index b2f6460..8798a69 100644 --- a/src/connect.zig +++ b/src/connect.zig @@ -56,16 +56,16 @@ pub fn connect( var path: []const u8 = undefined; var args = std.ArrayList([]const u8).init(alloc); - std.log.info("name: {s}", .{config.name}); - std.log.info("class {s}", .{config.class}); - std.log.info("type: {}", .{config.type}); - std.log.info("comment: {s}", .{config.comment}); - std.log.info("address: {s}", .{config.address}); - std.log.info("port: {d}", .{config.port}); - std.log.info("username: {s}", .{config.username}); - std.log.info("manufacturer: {s}", .{config.manufacturer}); - std.log.info("model: {s}", .{config.model}); - std.log.info("part number: {s}", .{config.part_number}); + // std.log.info("name: {s}", .{config.name}); + // std.log.info("class {s}", .{config.class}); + // std.log.info("type: {}", .{config.type}); + // std.log.info("comment: {s}", .{config.comment}); + // std.log.info("address: {s}", .{config.address}); + // std.log.info("port: {d}", .{config.port}); + // std.log.info("username: {s}", .{config.username}); + // std.log.info("manufacturer: {s}", .{config.manufacturer}); + // std.log.info("model: {s}", .{config.model}); + // std.log.info("part number: {s}", .{config.part_number}); switch (config.type) { .ssh => { @@ -134,9 +134,9 @@ pub fn connect( const argsZ = try alloc.allocSentinel(?[*:0]const u8, args.items.len, null); for (args.items, 0..) |arg, i| argsZ[i] = (try alloc.dupeZ(u8, arg)).ptr; - for (argsZ, 0..) |arg, i| { - if (arg) |a| std.log.info("{d} {s}", .{ i, a }); - } + // for (argsZ, 0..) |arg, i| { + // if (arg) |a| std.log.info("{d} {s}", .{ i, a }); + // } if (builtin.output_mode == .Exe) { const stdout_file = std.io.getStdOut().writer(); diff --git a/src/main.zig b/src/main.zig index 73d3959..53785fd 100644 --- a/src/main.zig +++ b/src/main.zig @@ -48,11 +48,6 @@ pub fn main() !void { } if (matches.subcommandMatches("connect")) |connect_matches| { - // if (!(connect_matches.containsArgs())) { - // try app.displaySubcommandHelp(); - // return; - // } - var it = connect_matches.args.keyIterator(); while (it.next()) |key| { logz.info().string("key", key.*).log(); @@ -72,10 +67,7 @@ pub fn main() !void { break :id null; }; - std.log.info("id: {any}", .{identities}); - if (identities) |i| { - logz.info().string("test", "test").log(); for (i) |identity| { logz.info().string("identity", identity).log(); const fullpath = fp: { @@ -98,8 +90,6 @@ pub fn main() !void { }; if (identity.ptr != fullpath.ptr) alloc.free(fullpath); } - } else { - logz.warn().string("message", "no identities").log(); } const proxy_jump = connect_matches.getSingleValue("proxy-jump"); @@ -113,7 +103,6 @@ pub fn main() !void { }; if (expanded) |v| { ssh_path = v; - // defer alloc.free(ssh_path); } } @@ -126,14 +115,10 @@ pub fn main() !void { break :expanded null; }; if (expanded) |v| { - std.log.info("expanded telnet path: {s}", .{v}); telnet_path = v; - // defer alloc.free(telnet_path); } } - std.log.info("ssh path: {s}", .{ssh_path}); - std.log.info("telnet path: {s}", .{telnet_path}); try connect.connect(alloc, config_path, identities, proxy_jump, ssh_path, telnet_path); return; @@ -164,7 +149,6 @@ fn expandPath(alloc: std.mem.Allocator, cmd: []const u8) !?[]u8 { path_buf[path_len] = 0; const full_path = path_buf[0..path_len :0]; - std.log.debug("path {s}", .{full_path}); const stat = std.fs.cwd().statFile(full_path) catch |err| switch (err) { error.FileNotFound => continue, error.AccessDenied => {