Skip to content

Commit

Permalink
Add logger to yeoman generator
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade committed May 25, 2016
1 parent 0db4444 commit 2f675ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import {logging} from 'react-server';

const logger = logging.getLogger(__LOGGER__);

export default class HelloWorld extends React.Component {
constructor(props) {
super(props);
this.state = {exclamationCount: 0};
this.handleClick = () => {
logger.info(`Getting more excited! previously ${this.state.exclamationCount} excitements.`);
this.setState({exclamationCount: this.state.exclamationCount + 1});
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"xo": {
"esnext": true,
"extends": "xo-react",
"globals": ["__LOGGER__"],
"ignores": ["__clientTemp/**/*"]
}
}
5 changes: 2 additions & 3 deletions packages/generator-react-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
},
"license": "Apache-2.0",
"xo": {
"envs": ["node"],
"extends": "xo-react",
"globals": ["__LOGGER__"],
"ignores": [
"test/**/*"
],
"envs": [
"node"
]
}
}

0 comments on commit 2f675ee

Please sign in to comment.