smartlog/ts/smartlog.classes.loggroup.ts

28 lines
775 B
TypeScript
Raw Normal View History

2022-06-26 08:35:35 +00:00
import * as plugins from './smartlog.plugins.js';
import { Smartlog } from './smartlog.classes.smartlog.js';
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,
2020-09-07 21:30:02 +00:00
transaction: this.transactionId,
2020-06-08 20:39:40 +00:00
});
}
2020-06-08 20:45:02 +00:00
}