0.1.0-1-alpha.2-fix.2
This commit is contained in:
38
crates/apps/game-reflex-poc-tauri/frontend/ts/logging.ts
Normal file
38
crates/apps/game-reflex-poc-tauri/frontend/ts/logging.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
// file: crates/apps/game-reflex-poc-tauri/frontend/ts/logging.ts
|
||||
// version: 1
|
||||
|
||||
import { attachConsole, debug, error, info, trace, warn } from "@fltsci/tauri-plugin-tracing";
|
||||
|
||||
let detachRustConsole: (() => void) | null = null;
|
||||
|
||||
export async function initializeTracing(): Promise<void> {
|
||||
detachRustConsole = await attachConsole();
|
||||
await info("Reflex Tauri frontend tracing initialized", "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export async function tracingTrace(message: string): Promise<void> {
|
||||
await trace(message, "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export async function tracingDebug(message: string): Promise<void> {
|
||||
await debug(message, "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export async function tracingInfo(message: string): Promise<void> {
|
||||
await info(message, "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export async function tracingWarn(message: string): Promise<void> {
|
||||
await warn(message, "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export async function tracingError(message: string): Promise<void> {
|
||||
await error(message, "games::tauri::reflex::frontend");
|
||||
}
|
||||
|
||||
export function detachTracingConsole(): void {
|
||||
if (detachRustConsole !== null) {
|
||||
detachRustConsole();
|
||||
detachRustConsole = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user