hook up logging to wasm, example uses new zig-js package

This commit is contained in:
Mitchell Hashimoto
2022-12-04 13:16:54 -08:00
parent 437f1772f1
commit c48d8cd151
9 changed files with 4547 additions and 48 deletions

View File

@@ -1,6 +1,17 @@
// This is the main file for the WASM module. The WASM module has to
// export a C ABI compatible API.
const std = @import("std");
const builtin = @import("builtin");
pub usingnamespace @import("os/wasm.zig");
pub usingnamespace @import("os/wasm/log.zig");
pub usingnamespace @import("font/main.zig");
// Set our log level. We try to get as much logging as possible but in
// ReleaseSmall mode where we're optimizing for space, we elevate the
// log level.
pub const log_level: std.log.Level = switch (builtin.mode) {
.Debug => .debug,
.ReleaseSmall => .warn,
else => .info,
};