aboutsummaryrefslogtreecommitdiff
path: root/lib/logger.js
diff options
context:
space:
mode:
authorNick Merwin <[email protected]>2019-11-20 17:05:48 -0800
committerGitHub <[email protected]>2019-11-20 17:05:48 -0800
commit336123fe05e7f80d79fc8522b4ff21a60fffe77c (patch)
tree97e5b9343471fc73ddf4ffb20cd71ca58367d6c6 /lib/logger.js
parenteba01a29c69f28ffd7f50556492a43b5ba2486d7 (diff)
downloadnode-coveralls-336123fe05e7f80d79fc8522b4ff21a60fffe77c.tar.xz
node-coveralls-336123fe05e7f80d79fc8522b4ff21a60fffe77c.zip
ES6
* remove unused variables * move `require`s at the top * check for prototype built-ins * run in strict mode * always check for error values in tests * make style consistent * mark Node.js 6 as the minimum supported version in package.json * Use the arrow return syntax * logger.js: use `Boolean` to make the intention clearer. * Use the rest params instead of arguments. * test/getOptions.js: beautify git data. * Update logger.js Remove `hasDebugEnvVariable` function; it's just a `process.env` check * Create .jshintrc
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/logger.js b/lib/logger.js
index 1c2ba68..4f71d74 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -1,16 +1,14 @@
-var index = require('../index');
+'use strict';
-module.exports = function(){
- return require('log-driver')({level : getLogLevel()});
-};
+const logDriver = require('log-driver');
+const index = require('..');
-function getLogLevel(){
- if (index.options.verbose || hasDebugEnvVariable()) {
+module.exports = () => logDriver({ level: getLogLevel() });
+
+function getLogLevel() {
+ if (index.options.verbose || Boolean(process.env.NODE_COVERALLS_DEBUG)) {
return 'debug';
}
- return 'error';
-}
-function hasDebugEnvVariable(){
- return process.env.NODE_COVERALLS_DEBUG == 1;
+ return 'error';
}