diff --git a/client/src/utils/graphql-errors.js b/client/src/utils/graphql-errors.js index 26b9c18ce..6eed0e939 100644 --- a/client/src/utils/graphql-errors.js +++ b/client/src/utils/graphql-errors.js @@ -3,10 +3,10 @@ const ErrorResponse = { } export const checkGraphQLError = error => { - console.log('checkGraphQLError ', ErrorResponse) + log.debug('checkGraphQLError ', ErrorResponse) if (error.search(/unique constraint/)) { const field = error.substring(error.indexOf('=') + 1) - console.log('unique constraint', field.replace(/ +/g, '')) + log.debug('unique constraint', field.replace(/ +/g, '')) } } diff --git a/client/src/utils/log.js b/client/src/utils/log.js new file mode 100644 index 000000000..47e819934 --- /dev/null +++ b/client/src/utils/log.js @@ -0,0 +1,7 @@ +import minilog from 'minilog' + +if (process.env.NODE_ENV === 'development') minilog.enable() + +const log = minilog('frontend') + +export default log diff --git a/client/src/views/common/components/TeamBar.js b/client/src/views/common/components/TeamBar.js index b51f22e13..67f5ef075 100644 --- a/client/src/views/common/components/TeamBar.js +++ b/client/src/views/common/components/TeamBar.js @@ -16,6 +16,8 @@ import SettingsApplicationsIcon from '@material-ui/icons/SettingsApplications' import { Link } from 'react-router-dom' +import log from '../../../utils/log' + const SettingsLink = props => const FBLink = props => const MembersLink = props => @@ -61,7 +63,7 @@ const styles = theme => ({ class TeamBar extends Component { render () { const { classes, user, match } = this.props - console.log('TeamBar: ', user, match) + log.debug('TeamBar: ', user, match) return (