badmfck-api-server 3.2.3 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,7 +95,7 @@ async function Initializer(services) {
95
95
  exports.Initializer = Initializer;
96
96
  class APIService extends BaseService_1.BaseService {
97
97
  static nextLogID = 0;
98
- version = "3.2.2";
98
+ version = "3.2.5";
99
99
  options;
100
100
  monitor = null;
101
101
  monitorIndexFile;
@@ -16,6 +16,7 @@ export interface ILogItem {
16
16
  text: string;
17
17
  date: string;
18
18
  source: string;
19
+ repeat: number;
19
20
  }
20
21
  export interface ILogServiceOptions {
21
22
  output?: (data: ILogItem) => void;
@@ -171,11 +171,20 @@ class LogService extends BaseService_1.BaseService {
171
171
  text: text,
172
172
  time: d.getTime(),
173
173
  date: this.createDate(d),
174
- source: source
174
+ source: source,
175
+ repeat: 0
175
176
  };
176
177
  if (this.options.output) {
177
178
  this.options.output(logitem);
178
179
  }
180
+ if (this.log.length > 0) {
181
+ const lastLogItem = this.log[this.log.length - 1];
182
+ if (lastLogItem && lastLogItem.text === logitem.text && lastLogItem.source === logitem.source && lastLogItem.level === logitem.level) {
183
+ lastLogItem.repeat++;
184
+ exports.S_LOG_CREATED.invoke(lastLogItem);
185
+ return;
186
+ }
187
+ }
179
188
  exports.S_LOG_CREATED.invoke(logitem);
180
189
  this.log.push(logitem);
181
190
  let limit = this.options.stackSize ?? 100;