mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Remove log from runtime (there's a plugin for that)
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
_ __ _ __
|
||||
| | / /___ _(_) /____
|
||||
| | /| / / __ `/ / / ___/
|
||||
| |/ |/ / /_/ / / (__ )
|
||||
|__/|__/\__,_/_/_/____/
|
||||
The electron alternative for Go
|
||||
(c) Lea Anthony 2019-present
|
||||
*/
|
||||
|
||||
/* jshint esversion: 9 */
|
||||
|
||||
import {newRuntimeCaller} from "./runtime";
|
||||
|
||||
let call = newRuntimeCaller("log");
|
||||
|
||||
/**
|
||||
* Logs a message.
|
||||
* @param {message} Message to log
|
||||
*/
|
||||
export function Log(message) {
|
||||
return call("Log", message);
|
||||
}
|
||||
@@ -12,7 +12,6 @@ The electron alternative for Go
|
||||
|
||||
import * as Clipboard from './clipboard';
|
||||
import * as Application from './application';
|
||||
import * as Log from './log';
|
||||
import * as Screens from './screens';
|
||||
import {Plugin, Call, callErrorCallback, callCallback} from "./calls";
|
||||
import {newWindow} from "./window";
|
||||
@@ -54,7 +53,6 @@ export function newRuntime(windowName) {
|
||||
return newRuntime(windowName);
|
||||
}
|
||||
},
|
||||
Log,
|
||||
Screens,
|
||||
Call,
|
||||
Plugin,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -84,8 +84,6 @@ func (m *MessageProcessor) HandleRuntimeCall(rw http.ResponseWriter, r *http.Req
|
||||
m.processEventsMethod(method, rw, r, targetWindow, params)
|
||||
case "application":
|
||||
m.processApplicationMethod(method, rw, r, targetWindow, params)
|
||||
case "log":
|
||||
m.processLogMethod(method, rw, r, targetWindow, params)
|
||||
case "contextmenu":
|
||||
m.processContextMenuMethod(method, rw, r, targetWindow, params)
|
||||
case "screens":
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/logger"
|
||||
)
|
||||
|
||||
func (m *MessageProcessor) processLogMethod(method string, rw http.ResponseWriter, _ *http.Request, window *WebviewWindow, params QueryParams) {
|
||||
switch method {
|
||||
case "Log":
|
||||
var msg logger.Message
|
||||
err := params.ToStruct(&msg)
|
||||
if err != nil {
|
||||
m.httpError(rw, "error parsing log message: %s", err.Error())
|
||||
return
|
||||
}
|
||||
msg.Sender = window.Name()
|
||||
globalApplication.Log(&msg)
|
||||
m.ok(rw)
|
||||
default:
|
||||
m.httpError(rw, "Unknown log method: %s", method)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user