smartlog/ts/smartlog.classes.loggroup.ts

28 lines
768 B
TypeScript
Raw Normal View History

2020-06-08 16:16:54 +00:00
import * as plugins from './smartlog.plugins';
2020-06-08 20:39:40 +00:00
import { Smartlog } from './smartlog.classes.smartlog';
2020-06-08 16:16:54 +00:00
2020-06-08 20:39:40 +00:00
export class LogGroup {
public smartlogRef: Smartlog;
public transactionId: string;
public groupId = plugins.isounique.uni();
2020-06-08 20:45:02 +00:00
2020-06-08 20:39:40 +00:00
constructor(smartlogInstance: Smartlog, transactionIdArg: string) {
this.smartlogRef = smartlogInstance;
this.transactionId = transactionIdArg;
}
2020-06-08 20:45:02 +00:00
public log(
logLevelArg: plugins.smartlogInterfaces.TLogLevel,
logMessageArg: string,
logDataArg?: any
) {
2020-06-08 20:39:40 +00:00
this.smartlogRef.log(logLevelArg, logMessageArg, logDataArg, {
id: plugins.isounique.uni(),
type: 'none',
group: this.groupId,
instance: this.smartlogRef.uniInstanceId,
transaction: this.transactionId
});
}
2020-06-08 20:45:02 +00:00
}