From 5fd8312f63e73b7c683217ecb6309784346cfff6 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Fri, 9 Oct 2020 14:51:26 +1100 Subject: [PATCH] Support Print in JS runtime --- v2/internal/runtime/js/core/log.js | 10 ++++++++++ v2/internal/runtime/js/runtime/log.js | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/v2/internal/runtime/js/core/log.js b/v2/internal/runtime/js/core/log.js index b0c7a714f..338acd7b4 100644 --- a/v2/internal/runtime/js/core/log.js +++ b/v2/internal/runtime/js/core/log.js @@ -35,6 +35,16 @@ export function Trace(message) { sendLogMessage('T', message); } +/** + * Log the given message with the backend + * + * @export + * @param {string} message + */ +export function Print(message) { + sendLogMessage('P', message); +} + /** * Log the given debug message with the backend * diff --git a/v2/internal/runtime/js/runtime/log.js b/v2/internal/runtime/js/runtime/log.js index 5e32f5b84..ccd952de2 100644 --- a/v2/internal/runtime/js/runtime/log.js +++ b/v2/internal/runtime/js/runtime/log.js @@ -11,6 +11,16 @@ The lightweight framework for web-like apps /* jshint esversion: 6 */ +/** + * Log the given message with the backend + * + * @export + * @param {string} message + */ +function Print(message) { + window.wails.Log.Print(message); +} + /** * Log the given trace message with the backend * @@ -72,6 +82,8 @@ function Fatal(message) { } module.exports = { + Print: Print, + Trace: Trace, Debug: Debug, Info: Info, Warning: Warning,