gnh1201 / welsonjs

WelsonJS - Build a Windows app on the Windows built-in JavaScript engine

Home Page:https://catswords.social/@catswords_oss

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[app] Logging into the file

gnh1201 opened this issue · comments

[app] Logging into the file

I added the _echoCallback member variable. If _echoCallback is a function, it will be called when warn, info, error log level in the console.

This is an example of logging into the file:

console._echoCallback = function() {
    var content = console._messages.join("\r\n");
    FILE.writeFile("data\\log_scan.txt", content, "utf-8");
};