@@ -4,6 +4,8 @@ const util = @import("util.zig");
44const backends = @import ("backends.zig" );
55const conv = @import ("conv.zig" );
66
7+ const log = std .log .scoped (.sysaudio );
8+
79pub const Backend = backends .Backend ;
810pub const Range = util .Range ;
911
@@ -33,18 +35,23 @@ pub const Context = struct {
3335 pub fn init (comptime backend : ? Backend , allocator : std.mem.Allocator , options : Options ) InitError ! Context {
3436 const data : backends.Context = blk : {
3537 if (backend ) | b | {
36- break : blk try @typeInfo (
38+ const d = try @typeInfo (
3739 std .meta .fieldInfo (backends .Context , b ).type ,
3840 ).pointer .child .init (allocator , options );
41+ log .info ("Backend selected: {s}" , .{b .name });
42+ break :blk d ;
3943 } else {
4044 inline for (std .meta .fields (Backend ), 0.. ) | b , i | {
4145 if (@typeInfo (
4246 std .meta .fieldInfo (backends .Context , @as (Backend , @enumFromInt (b .value ))).type ,
4347 ).pointer .child .init (allocator , options )) | d | {
48+ log .info ("Backend selected: {s}" , .{b .name });
4449 break :blk d ;
4550 } else | err | {
46- if (i == std .meta .fields (Backend ).len - 1 )
51+ if (i == std .meta .fields (Backend ).len - 1 ) {
52+ log .info ("Init failed of Backend: {s}" , .{b .name });
4753 return err ;
54+ }
4855 }
4956 }
5057 unreachable ;
0 commit comments