mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-25 12:30:18 +00:00
Start logging
This commit is contained in:
parent
e7b54c7ee8
commit
2682575348
3 changed files with 34 additions and 3 deletions
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -5262,6 +5262,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"electron-log": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.2.0.tgz",
|
||||
"integrity": "sha512-Yy1X8iZEzoBA8pu5b7YU07dRHi1GPM9C5jLEOn87Uqtdc9rbe6KbvvQ/AAAtGvn4/GC3azRW/eeiSI4ZF+Hm2A=="
|
||||
},
|
||||
"electron-publish": {
|
||||
"version": "21.2.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-21.2.0.tgz",
|
||||
|
@ -7461,6 +7466,11 @@
|
|||
"integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==",
|
||||
"dev": true
|
||||
},
|
||||
"is-electron": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.0.tgz",
|
||||
"integrity": "sha512-SpMppC2XR3YdxSzczXReBjqs2zGscWQpBIKqwXYBFic0ERaxNVgwLCHwOLZeESfdJQjX0RDvrJ1lBXX2ij+G1Q=="
|
||||
},
|
||||
"is-extendable": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
"buefy": "^0.8.17",
|
||||
"bulma": "^0.8.2",
|
||||
"core-js": "^3.6.4",
|
||||
"electron-log": "^4.2.0",
|
||||
"is-electron": "^2.2.0",
|
||||
"secure-ls": "^1.2.6",
|
||||
"vue": "^2.6.11",
|
||||
"vue-i18n": "^8.17.3",
|
||||
|
|
25
src/main.js
25
src/main.js
|
@ -20,12 +20,31 @@ Vue.use(Vuex);
|
|||
Vue.use(VueSidebarMenu)
|
||||
Vue.use(Buefy);
|
||||
|
||||
let isElectron = require("is-electron");
|
||||
|
||||
if(isElectron()){
|
||||
const log = require('electron-log');
|
||||
log.transports.file.level = 'info';
|
||||
log.transports.console.level = 'silly';
|
||||
log.transports.file.appName = 'WebTools-NGGed.log'
|
||||
console.log = log.log;
|
||||
|
||||
|
||||
var version = require('electron').remote.app.getVersion();
|
||||
var name = require('electron').remote.app.getName();
|
||||
log.info('Starting ' + name + ' Version:' + version);
|
||||
|
||||
|
||||
|
||||
log.debug('Not logged in file, only in console, since file log level is info')
|
||||
|
||||
log.info("Electron aww yeahhh !");
|
||||
}else{
|
||||
console.log("Running in native Vue as a normal browser");
|
||||
}
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
||||
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
router: router,
|
||||
|
|
Loading…
Reference in a new issue