lambda-monitor-logger
Advanced tools
Comparing version 3.2.2 to 3.3.0
@@ -5,15 +5,24 @@ "use strict"; | ||
const maxStringLength = 512; | ||
const callback = (match, idx, str) => { | ||
const prevChar = str[idx - 1]; | ||
return prevChar === ',' || prevChar === ':' ? '' : ' '; | ||
}; | ||
module.exports = value => util.inspect(value, { | ||
compact: true, | ||
maxArrayLength: 14, | ||
depth: 16, | ||
stylize: (str, type) => { | ||
if (type === 'string' && str.length > maxStringLength) { | ||
return `${str.slice(0, maxStringLength + 1)}...`; | ||
module.exports = (value, { | ||
stripLineBreaks = true, | ||
maxLength = 512 | ||
} = {}) => { | ||
const r = util.inspect(value, { | ||
compact: true, | ||
maxArrayLength: 14, | ||
depth: 16, | ||
stylize: (str, type) => { | ||
if (type === 'string' && str.length > maxLength) { | ||
return `${str.slice(0, maxLength + 1)}...`; | ||
} | ||
return str; | ||
} | ||
return str; | ||
} | ||
}).replace(/\s*\n\s*/g, ''); | ||
}); | ||
return stripLineBreaks ? r.replace(/\s*\n\s*/g, callback) : r; | ||
}; |
{ | ||
"name": "lambda-monitor-logger", | ||
"version": "3.2.2", | ||
"version": "3.3.0", | ||
"description": "Logging designed to be used with lambda-monitor", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -44,1 +44,18 @@ # lambda-monitor-logger | ||
Log messages below the currently set log level are completely ignored. | ||
## Abbrev Options | ||
### stripLineBreaks | ||
Type: `boolean`<br> | ||
Default: `true` | ||
When set to true, line breaks are stripped. | ||
### maxLength | ||
Type: `integer`<br> | ||
Default: `512` | ||
The maximum output length. |
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
9762
110
61