Compare commits

..

4 Commits

Author SHA1 Message Date
7be0e70754 2.0.35 2020-06-11 14:41:12 +00:00
8b0ceb759d fix(core): update 2020-06-11 14:41:11 +00:00
7b5cfb2c95 2.0.34 2020-06-11 14:28:04 +00:00
a4a5b18849 fix(core): update 2020-06-11 14:28:03 +00:00
4 changed files with 12 additions and 4 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartlog",
"version": "2.0.33",
"version": "2.0.35",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartlog",
"version": "2.0.33",
"version": "2.0.35",
"private": false,
"description": "minimalistic distributed and extensible logging tool",
"keywords": [

View File

@ -42,6 +42,7 @@ tap.test('should create a log group', async () => {
tap.test('should catch error', async () => {
console.error(new Error('hey'));
// throw new Error('hey');
});
tap.start();

View File

@ -42,8 +42,15 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
flags: 'a+'
}); */
process.stdout.write = (...args) => {
if (!args[0].startsWith('LOG')) {
this.log('info', args[0]);
const logString: string = args[0];
if (!logString.startsWith('LOG') && typeof logString === 'string') {
switch(true) {
case logString.substr(0, 20).includes('Error:'):
this.log('error', logString);
break;
default:
this.log('info', logString);
}
return;
}
// fileStream.write(args[0]);