Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
47583bd955 | |||
018bc7054a | |||
5ca4cb9964 | |||
27bb9a789c | |||
5f7e68d5b7 | |||
da0edc478c |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartlog",
|
||||
"version": "2.0.30",
|
||||
"version": "2.0.33",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartlog",
|
||||
"version": "2.0.30",
|
||||
"version": "2.0.33",
|
||||
"private": false,
|
||||
"description": "minimalistic distributed and extensible logging tool",
|
||||
"keywords": [
|
||||
|
@ -40,4 +40,8 @@ tap.test('should create a log group', async () => {
|
||||
logGroup.log('info', 'this is logged from a log group');
|
||||
});
|
||||
|
||||
tap.test('should catch error', async () => {
|
||||
console.error(new Error('hey'));
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -4,7 +4,12 @@ import * as plugins from './smartlog.plugins';
|
||||
* a console log optimized for smartlog
|
||||
*/
|
||||
export class ConsoleLog {
|
||||
public log(logLevelArg: plugins.smartlogInterfaces.TLogLevel, logMessageArg: string) {
|
||||
public log(
|
||||
logLevelArg: plugins.smartlogInterfaces.TLogLevel,
|
||||
logMessageArg: string,
|
||||
dataArg?: any,
|
||||
correlationArg?: plugins.smartlogInterfaces.ILogCorrelation
|
||||
) {
|
||||
console.log(`__# ${logLevelArg}: ${logMessageArg}`);
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
|
||||
process.stderr.write = (...args) => {
|
||||
if (!args[0].startsWith('LOG')) {
|
||||
this.log('info', args[0]);
|
||||
this.log('error', args[0]);
|
||||
return;
|
||||
}
|
||||
// fileStream.write(args[0]);
|
||||
|
Reference in New Issue
Block a user