mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-05 02:22:11 +08:00
60 lines
1.6 KiB
JavaScript
60 lines
1.6 KiB
JavaScript
// 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.
|
|
|
|
/**
|
|
* 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>}
|
|
*/
|
|
|
|
function Debug(input, ...args) {
|
|
return wails.CallByID(4111675027, input, ...args);
|
|
}
|
|
|
|
/**
|
|
* 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>}
|
|
*/
|
|
function Info(input, ...args) {
|
|
return wails.CallByID(2391172776, input, ...args);
|
|
}
|
|
|
|
/**
|
|
* 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>}
|
|
*/
|
|
function Warning(input, ...args) {
|
|
return wails.CallByID(2762394760, input, ...args);
|
|
}
|
|
|
|
/**
|
|
* 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>}
|
|
*/
|
|
function Error(input, ...args) {
|
|
return wails.CallByID(878590242, input, ...args);
|
|
}
|
|
|
|
const LevelDebug = -4
|
|
const LevelInfo = 0
|
|
const LevelWarn = 4
|
|
const LevelError = 8
|
|
|
|
|
|
/**
|
|
* Set Log level
|
|
* @param level {LogLevel} - The log level to set.
|
|
* @returns {Promise<void|Error>}
|
|
*/
|
|
function SetLogLevel(level) {
|
|
return wails.CallByID(2758810652, level);
|
|
}
|