appium-logger
Advanced tools
Comparing version 1.1.4 to 1.1.5
'use strict'; | ||
var _slicedToArray = require('babel-runtime/helpers/sliced-to-array')['default']; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
@@ -56,5 +58,6 @@ | ||
var forceLogMode = parseInt(process.env._FORCE_LOGS, 10) === 1; | ||
var usingGlobalLog = !!global._global_npmlog; | ||
var logger = testingMode && !forceLogMode ? mockLog : global._global_npmlog || _npmlog2['default']; | ||
patchLogger(logger); | ||
return logger; | ||
return [logger, usingGlobalLog]; | ||
} | ||
@@ -65,3 +68,9 @@ | ||
var logger = _getLogger(); | ||
var _getLogger2 = _getLogger(); | ||
var _getLogger22 = _slicedToArray(_getLogger2, 2); | ||
var logger = _getLogger22[0]; | ||
var usingGlobalLog = _getLogger22[1]; | ||
var wrappedLogger = {}; | ||
@@ -110,3 +119,8 @@ _Object$defineProperty(wrappedLogger, 'level', { | ||
}; | ||
wrappedLogger.level = 'verbose'; | ||
if (!usingGlobalLog) { | ||
// if we're not using a global log specified from some top-level package, | ||
// set the log level to a default of verbose. Otherwise, let the top-level | ||
// package set the log level | ||
wrappedLogger.level = 'verbose'; | ||
} | ||
return wrappedLogger; | ||
@@ -118,2 +132,2 @@ } | ||
exports['default'] = log; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9sb2dnZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O1FBUWdCLFdBQVcsR0FBWCxXQUFXO1FBZVgsU0FBUyxHQUFULFNBQVM7O3NCQXZCTixRQUFROzs7O0FBRTNCLElBQU0sU0FBUyxHQUFHLENBQUMsT0FBTyxFQUFFLFNBQVMsRUFBRSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsT0FBTyxDQUFDLENBQUM7QUFDakYsSUFBSSxPQUFPLEdBQUcsRUFBRSxDQUFDO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zdCBsb2cgPSBnZXRMb2dnZXIoKTtcblxuZXhwb3J0IGRlZmF1bHQgbG9nO1xuIl19 |
@@ -18,10 +18,11 @@ import npmlog from 'npmlog'; | ||
const forceLogMode = parseInt(process.env._FORCE_LOGS, 10) === 1; | ||
const usingGlobalLog = !!global._global_npmlog; | ||
let logger = (testingMode && !forceLogMode) ? mockLog : | ||
(global._global_npmlog || npmlog); | ||
patchLogger(logger); | ||
return logger; | ||
return [logger, usingGlobalLog]; | ||
} | ||
export function getLogger(prefix = null) { | ||
let logger = _getLogger(); | ||
let [logger, usingGlobalLog] = _getLogger(); | ||
let wrappedLogger = {}; | ||
@@ -44,3 +45,8 @@ Object.defineProperty(wrappedLogger, 'level', { | ||
}; | ||
wrappedLogger.level = 'verbose'; | ||
if (!usingGlobalLog) { | ||
// if we're not using a global log specified from some top-level package, | ||
// set the log level to a default of verbose. Otherwise, let the top-level | ||
// package set the log level | ||
wrappedLogger.level = 'verbose'; | ||
} | ||
return wrappedLogger; | ||
@@ -47,0 +53,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"author": "appium", | ||
@@ -10,0 +10,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45988
593