chore(config): add log message

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:13:10 -03:00
parent 1c91b497bc
commit 40062d4dfe
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ const toml = @import("toml");
const Allocator = std.mem.Allocator;
const log = std.log.scoped(.Config);
var state: Config = .{};
const Config = struct {
@ -52,6 +53,8 @@ pub fn load(allocator: Allocator, config_path: []const u8) !void {
var config_file = try std.fs.cwd().openFile(config_path, .{});
defer config_file.close();
log.info("loaded from {s}", .{config_path});
const contents = try config_file.readToEndAlloc(allocator, try config_file.getEndPos());
defer allocator.free(contents);