arnaucube
arnaucube/commonroutesServerPublic Self-hosted repository
commonroutesServer/www/platforms/android/cordova/loggingHelper.js
www/platforms/android/cordova/loggingHelper.jsRaw
 1var CordovaLogger = require('cordova-common').CordovaLogger;
 2
 3module.exports = {
 4    adjustLoggerLevel: function (opts) {
 5        if (opts instanceof Array) {
 6            opts.silent = opts.indexOf('--silent') !== -1;
 7            opts.verbose = opts.indexOf('--verbose') !== -1;
 8        }
 9
10        if (opts.silent) {
11            CordovaLogger.get().setLevel('error');
12        }
13
14        if (opts.verbose) {
15            CordovaLogger.get().setLevel('verbose');
16        }
17    }
18};