Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7be0e70754 | |||
8b0ceb759d | |||
7b5cfb2c95 | |||
a4a5b18849 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartlog",
|
||||
"version": "2.0.33",
|
||||
"version": "2.0.35",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -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": [
|
||||
|
@ -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();
|
||||
|
@ -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]);
|
||||
|
Reference in New Issue
Block a user