aboutsummaryrefslogtreecommitdiff
path: root/lib/logger.js
diff options
context:
space:
mode:
authorAnna Henningsen <[email protected]>2015-04-15 17:11:10 +0200
committerAnna Henningsen <[email protected]>2015-12-10 22:14:42 +0100
commitbe2f7b8407e84bd3db1c3d30b2a0b225c9faaf15 (patch)
tree1fd3ed200472f5b6c19123ecf3b04aa6b837d869 /lib/logger.js
parent879fb9e850ef569c37dd255059f0e63b6029281a (diff)
downloadnode-coveralls-be2f7b8407e84bd3db1c3d30b2a0b225c9faaf15.tar.xz
node-coveralls-be2f7b8407e84bd3db1c3d30b2a0b225c9faaf15.zip
Use minimist to parse command line options
The command line options are made available as a object via `index.options`
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/logger.js b/lib/logger.js
index a847a41..f834586 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -1,19 +1,16 @@
+var index = require('../index');
+
module.exports = function(){
return require('log-driver')({level : getLogLevel()});
};
function getLogLevel(){
- if (hasVerboseCommandLineOption() || hasDebugEnvVariable()) {
+ if (index.options.verbose || hasDebugEnvVariable()) {
return 'warn';
}
return 'error';
}
-function hasVerboseCommandLineOption(){
- // look into command line arguments starting from index 2
- return process.argv.slice(2).filter(RegExp.prototype.test.bind(/^(-v|--verbose)$/)).length > 0;
-}
-
function hasDebugEnvVariable(){
return process.env.NODE_COVERALLS_DEBUG == 1;
}