Files

62 lines
1.6 KiB
JavaScript
Raw Permalink Normal View History

2023-03-22 20:56:45 +11:00
// plugin.js
// This file should contain helper functions for the that can be used by the frontend.
// Below are examples of how to use JSDoc to define the Hashes struct and the exported functions.
2024-04-11 20:43:13 +10:00
import {Call} from '/wails/runtime.js';
2023-03-22 20:56:45 +11:00
/**
* Log at the Debug level.
* @param input {string} - The message in printf format.
* @param args {...any} - The arguments for the log message.
* @returns {Promise<void|Error>}
*/
2024-04-11 20:43:13 +10:00
export function Debug(input, ...args) {
return Call.ByID(4111675027, input, ...args);
2023-03-22 20:56:45 +11:00
}
/**
* Log at the Info level.
* @param input {string} - The message in printf format.
* @param args {...any} - The arguments for the log message.
* @returns {Promise<void|Error>}
*/
2024-04-11 20:43:13 +10:00
export function Info(input, ...args) {
return Call.ByID(2391172776, input, ...args);
2023-03-22 20:56:45 +11:00
}
/**
* Log at the Warning level.
* @param input {string} - The message in printf format.
* @param args {...any} - The arguments for the log message.
* @returns {Promise<void|Error>}
*/
2024-04-11 20:43:13 +10:00
export function Warning(input, ...args) {
return Call.ByID(2762394760, input, ...args);
2023-03-22 20:56:45 +11:00
}
/**
* Log at the Error level.
* @param input {string} - The message in printf format.
* @param args {...any} - The arguments for the log message.
* @returns {Promise<void|Error>}
*/
2024-04-11 20:43:13 +10:00
export function Error(input, ...args) {
return Call.ByID(878590242, input, ...args);
2023-03-22 20:56:45 +11:00
}
2023-09-13 09:45:26 +10:00
2024-04-11 20:43:13 +10:00
export const LevelDebug = -4
export const LevelInfo = 0
export const LevelWarn = 4
export const LevelError = 8
2023-09-13 09:45:26 +10:00
/**
* Set Log level
* @param level {LogLevel} - The log level to set.
* @returns {Promise<void|Error>}
*/
2024-04-11 20:43:13 +10:00
export function SetLogLevel(level) {
return Call.ByID(2758810652, level);
2023-09-13 09:45:26 +10:00
}