chore(config): add log message
This commit is contained in:
parent
fc53a40b3c
commit
2474daa3ae
|
@ -3,6 +3,7 @@ const toml = @import("toml");
|
||||||
|
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
|
|
||||||
|
const log = std.log.scoped(.Config);
|
||||||
var state: Config = .{};
|
var state: Config = .{};
|
||||||
|
|
||||||
const Config = struct {
|
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, .{});
|
var config_file = try std.fs.cwd().openFile(config_path, .{});
|
||||||
defer config_file.close();
|
defer config_file.close();
|
||||||
|
|
||||||
|
log.info("loaded from {s}", .{config_path});
|
||||||
|
|
||||||
const contents = try config_file.readToEndAlloc(allocator, try config_file.getEndPos());
|
const contents = try config_file.readToEndAlloc(allocator, try config_file.getEndPos());
|
||||||
defer allocator.free(contents);
|
defer allocator.free(contents);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue