@rettersoft/retter-log
Advanced tools
Comparing version
@@ -10,4 +10,4 @@ "use strict"; | ||
var records = []; | ||
const origlog = console.log; | ||
function overrideConsoleLog() { | ||
const origlog = console.log; | ||
console.log = function (...args) { | ||
@@ -39,6 +39,12 @@ const message = arguments[0]; | ||
async function onExit() { | ||
await Kinesis.putRecords({ | ||
StreamName: RETTERLOG_KINESIS, | ||
Records: records, | ||
}).promise(); | ||
try { | ||
await Kinesis.putRecords({ | ||
StreamName: RETTERLOG_KINESIS, | ||
Records: records, | ||
}).promise(); | ||
} | ||
catch (e) { | ||
origlog("Catched!"); | ||
origlog(e); | ||
} | ||
process.exit(); | ||
@@ -45,0 +51,0 @@ } |
17
index.ts
@@ -11,4 +11,5 @@ | ||
var records : PutRecordsRequestEntryList = [] | ||
const origlog = console.log; | ||
function overrideConsoleLog(){ | ||
const origlog = console.log; | ||
console.log = function(...args: any) { | ||
@@ -43,6 +44,12 @@ | ||
async function onExit(){ | ||
await Kinesis.putRecords({ | ||
StreamName: RETTERLOG_KINESIS!, | ||
Records: records, | ||
}).promise(); | ||
try{ | ||
await Kinesis.putRecords({ | ||
StreamName: RETTERLOG_KINESIS!, | ||
Records: records, | ||
}).promise(); | ||
} | ||
catch(e){ | ||
origlog("Catched!") | ||
origlog(e) | ||
} | ||
process.exit(); | ||
@@ -49,0 +56,0 @@ } |
{ | ||
"name": "@rettersoft/retter-log", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Streams logs with certain format", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
4151
4.9%117
11.43%