mirror of
https://github.com/mikkelam/fast-cli.git
synced 2025-12-18 12:54:05 +00:00
Switch back to std.log for debug logging
This commit is contained in:
parent
75a6d2fa6c
commit
898b3b52c6
1 changed files with 7 additions and 5 deletions
|
|
@ -3,6 +3,8 @@ const zli = @import("zli");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const Writer = std.Io.Writer;
|
const Writer = std.Io.Writer;
|
||||||
|
|
||||||
|
const log = std.log.scoped(.cli);
|
||||||
|
|
||||||
const Fast = @import("../lib/fast.zig").Fast;
|
const Fast = @import("../lib/fast.zig").Fast;
|
||||||
const HTTPSpeedTester = @import("../lib/http_speed_tester_v2.zig").HTTPSpeedTester;
|
const HTTPSpeedTester = @import("../lib/http_speed_tester_v2.zig").HTTPSpeedTester;
|
||||||
|
|
||||||
|
|
@ -67,7 +69,7 @@ fn run(ctx: zli.CommandContext) !void {
|
||||||
|
|
||||||
const spinner = ctx.spinner;
|
const spinner = ctx.spinner;
|
||||||
|
|
||||||
try spinner.print("Config: https={}, upload={}, json={}, max_duration={}s\n", .{
|
log.info("Config: https={}, upload={}, json={}, max_duration={}s", .{
|
||||||
use_https, check_upload, json_output, max_duration,
|
use_https, check_upload, json_output, max_duration,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -87,9 +89,9 @@ fn run(ctx: zli.CommandContext) !void {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
try spinner.print("Got {} URLs\n", .{urls.len});
|
log.info("Got {} URLs\n", .{urls.len});
|
||||||
for (urls) |url| {
|
for (urls) |url| {
|
||||||
try spinner.print("URL: {s}\n", .{url});
|
log.info("URL: {s}\n", .{url});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Measure latency first
|
// Measure latency first
|
||||||
|
|
@ -108,7 +110,7 @@ fn run(ctx: zli.CommandContext) !void {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!json_output) {
|
if (!json_output) {
|
||||||
try spinner.start("Measuring download speed...", .{});
|
log.info("Measuring download speed...", .{});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize speed tester
|
// Initialize speed tester
|
||||||
|
|
@ -144,7 +146,7 @@ fn run(ctx: zli.CommandContext) !void {
|
||||||
var upload_result: ?SpeedTestResult = null;
|
var upload_result: ?SpeedTestResult = null;
|
||||||
if (check_upload) {
|
if (check_upload) {
|
||||||
if (!json_output) {
|
if (!json_output) {
|
||||||
try spinner.start("Measuring upload speed...", .{});
|
log.info("Measuring upload speed...", .{});
|
||||||
}
|
}
|
||||||
|
|
||||||
upload_result = if (json_output) blk: {
|
upload_result = if (json_output) blk: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue