remove base logger

This commit is contained in:
2025-10-27 14:14:56 +01:00
parent 6efcfcded9
commit f489c96de2

View File

@@ -4,9 +4,6 @@ const builtin = @import("builtin");
pub const options: Options = if (@hasDecl(root, "faller_options")) root.faller_options else .{}; pub const options: Options = if (@hasDecl(root, "faller_options")) root.faller_options else .{};
/// The base logger to create scopes from. Or just use `Logger` directly.
pub const logger = Logger(&.{});
pub const Options = struct { pub const Options = struct {
function: fn ( function: fn (
comptime []const @Type(.enum_literal), comptime []const @Type(.enum_literal),
@@ -28,6 +25,15 @@ pub const Options = struct {
disabled_in_test: bool = true, disabled_in_test: bool = true,
}; };
/// Used to create a logger from.
///
/// Examples:
/// ```zig
/// const logger = Logger(&.{.my_module});
/// const foo_bar_logger = Logger(&.{.foo, .bar});
/// const foo_bar_log = foo_bar_logger.log;
///
/// ```
pub fn Logger(comptime base_tags: []const @Type(.enum_literal)) type { pub fn Logger(comptime base_tags: []const @Type(.enum_literal)) type {
return struct { return struct {
/// Creates a new logger with an extended tag prefix. /// Creates a new logger with an extended tag prefix.