Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 14a6878

Browse files
authored
Straighten out the logging story. (#10)
1 parent 2489fbc commit 14a6878

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

fuse.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Sparky.task('default', ['copy-html'], () => {
2020
homeDir: 'src',
2121
output: `${OUTPUT_DIR}/$name.js`,
2222
target: 'electron',
23+
log: isProduction,
2324
cache: !isProduction,
2425
sourceMaps: true
2526
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@
7171
"postinstall": "Used by electron-builder to build native dependencies.",
7272
"start": "Starts the app in dev mode."
7373
},
74-
"version": "0.4.0"
74+
"version": "0.5.0"
7575
}

src/main/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { createWindow } from './create-window'
33
import * as log from 'electron-log'
44
import * as isDev from 'electron-is-dev'
55
import { setupAutoUpdates } from './auto-updater'
6+
67
// set proper logging level
7-
log.transports.file.level = isDev ? 'error' : 'debug'
8+
log.transports.file.level = isDev ? false : 'info'
9+
log.transports.console.level = isDev ? 'debug' : false
810

911
// usually we'd just use __dirname here, however, the FuseBox
1012
// bundler rewrites that, so we have to get it from Electron.

src/renderer/app/app.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
import * as React from 'react'
32
import { Text, Logo, FunDog } from '../platform'
3+
// import * as log from 'electron-log'
44

55
const appStyle = {
66
flex: 1,
@@ -25,6 +25,15 @@ const textStyle = {
2525
}
2626

2727
export class App extends React.Component<{}, {}> {
28+
29+
componentWillMount () {
30+
// log.debug('example of logging')
31+
}
32+
33+
componentDidMount () {
34+
// log.info('more logging')
35+
}
36+
2837
render() {
2938
return (
3039
<div style={appStyle}>

0 commit comments

Comments
 (0)