Comparing version 0.0.6 to 0.0.7
@@ -62,3 +62,3 @@ 'use strict'; | ||
catch (err) { | ||
this.localLog(['error', 'kinene', 'log'], err.message); | ||
this.localLog(['error', 'kinene', 'log'], { error: err.message }); | ||
} | ||
@@ -70,3 +70,3 @@ } | ||
// 'data' is optional | ||
this.server.log(tags, data); | ||
this.server.log(tags, this.addTime(data)); | ||
} | ||
@@ -81,8 +81,7 @@ | ||
logInfo = { | ||
tags, | ||
logInfo = this.formatLog({ | ||
...logInfo, | ||
source: logInfo.source || LOGS_SOURCE, | ||
isTest: testMode | ||
}; | ||
}); | ||
@@ -133,7 +132,2 @@ try { | ||
putTestRecords(...args) { | ||
return this.kinesis.putTestRecords(...args); | ||
} | ||
// TODO in addition to this local 'append', it's worth sending this data to kinesis with some redacted info or something | ||
@@ -161,13 +155,23 @@ async appendLocal({ id, msg }) { | ||
formatRecord(record) { | ||
formatLog(log) { | ||
const { arrayIfy } = internals; | ||
return { | ||
...this.addTime(log), | ||
tags: log.tags ? arrayIfy(log.tags) : [] | ||
}; | ||
} | ||
addTime(log) { | ||
const { localeStringCountry, localeStringTimezone, localeStringAbbrev } = this.options; | ||
const { arrayIfy } = internals; | ||
const now = new Date(); | ||
return { | ||
...record, | ||
tags: record.tags ? arrayIfy(record.tags) : [], | ||
timestamp: record.timestamp || now.getTime(), | ||
timestampReadable: record.timestampReadable || `${now.toLocaleString(localeStringCountry || 'en-US', { timeZone: localeStringTimezone || 'America/New_York' })} ${localeStringAbbrev || (localeStringTimezone ? '' : (this.isDstObserved ? 'EDT' : 'EST'))}` | ||
...log, | ||
timestamp: log.timestamp || now.getTime(), | ||
timestampISO: now.toISOString(), | ||
timestampReadable: log.timestampReadable || `${now.toLocaleString(localeStringCountry || 'en-US', { timeZone: localeStringTimezone || 'America/New_York' })} ${localeStringAbbrev || (localeStringTimezone ? '' : (this.isDstObserved ? 'EDT' : 'EST'))}` | ||
}; | ||
@@ -174,0 +178,0 @@ } |
{ | ||
"name": "kinene", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "wswoodruff", |
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
7169
157