Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose utils from extism, particularly logging #10

Open
nilslice opened this issue Oct 30, 2024 · 0 comments
Open

expose utils from extism, particularly logging #10

nilslice opened this issue Oct 30, 2024 · 0 comments
Assignees

Comments

@nilslice
Copy link
Member

very convenient to have a function like:

/// Logs format string to host, if log level is enabled.
pub fn log(level: comptime_int, comptime fmt: []const u8, args: anytype) !void {
    const msg = try std.fmt.allocPrint(_plugin.allocator, fmt, args);
    _plugin.log(@enumFromInt(level), msg);
}

Which is better if we have pub LogLevel in Extism zig-pdk, among other changes: extism/zig-pdk#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant