remove base logger
This commit is contained in:
12
src/root.zig
12
src/root.zig
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user