fix(core): update

This commit is contained in:
Philipp Kunz 2020-06-08 20:45:02 +00:00
parent a604b8e375
commit ffff60772c
4 changed files with 10 additions and 8 deletions

View File

@ -46,4 +46,4 @@
"npmextra.json",
"readme.md"
]
}
}

View File

@ -76,7 +76,6 @@ The following destinations are available:
// TBD
```
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)

View File

@ -7,7 +7,7 @@ let testSmartLog: smartlog.Smartlog;
tap.test('should produce a valid ConsoleLog instance', async () => {
testConsoleLog = new smartlog.ConsoleLog();
testConsoleLog.log('ok', 'this is ok');
})
});
tap.test('should produce instance of Smartlog', async () => {
testSmartLog = new smartlog.Smartlog({
@ -38,6 +38,6 @@ tap.test('should be able to log things', async () => {
tap.test('should create a log group', async () => {
const logGroup = testSmartLog.createLogGroup('some cool transaction');
logGroup.log('info', 'this is logged from a log group');
})
});
tap.start();

View File

@ -5,13 +5,17 @@ export class LogGroup {
public smartlogRef: Smartlog;
public transactionId: string;
public groupId = plugins.isounique.uni();
constructor(smartlogInstance: Smartlog, transactionIdArg: string) {
this.smartlogRef = smartlogInstance;
this.transactionId = transactionIdArg;
}
public log(logLevelArg: plugins.smartlogInterfaces.TLogLevel, logMessageArg: string, logDataArg?: any) {
public log(
logLevelArg: plugins.smartlogInterfaces.TLogLevel,
logMessageArg: string,
logDataArg?: any
) {
this.smartlogRef.log(logLevelArg, logMessageArg, logDataArg, {
id: plugins.isounique.uni(),
type: 'none',
@ -20,5 +24,4 @@ export class LogGroup {
transaction: this.transactionId
});
}
}
}