From 1b32552e73bd50cf0e6aba224ad78ad5dd81fe4a Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreplay.github.com> Date: Thu, 23 Jun 2022 21:05:27 +1000 Subject: [PATCH] mach: re-export log_level and scope_levels from App --- src/platform/native.zig | 3 +++ src/platform/wasm.zig | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/native.zig b/src/platform/native.zig index 2a266016..4cf8ab64 100644 --- a/src/platform/native.zig +++ b/src/platform/native.zig @@ -8,6 +8,9 @@ const enums = @import("../enums.zig"); const util = @import("util.zig"); const c = @import("c.zig").c; +pub const scope_levels = if (@hasDecl(App, "scope_levels")) App.scope_levels else [0]std.log.ScopeLevel{}; +pub const log_level = if (@hasDecl(App, "log_level")) App.log_level else std.log.default_level; + pub const Platform = struct { window: glfw.Window, backend_type: gpu.Adapter.BackendType, diff --git a/src/platform/wasm.zig b/src/platform/wasm.zig index 176a2b60..13da5883 100644 --- a/src/platform/wasm.zig +++ b/src/platform/wasm.zig @@ -231,7 +231,8 @@ export fn wasmDeinit() void { app.deinit(&engine); } -pub const log_level = .info; +pub const log_level = if (@hasDecl(App, "log_level")) App.log_level else .info; +pub const scope_levels = if (@hasDecl(App, "scope_levels")) App.scope_levels else [0]std.log.ScopeLevel{}; const LogError = error{}; const LogWriter = std.io.Writer(void, LogError, writeLog);