badmfck-api-server 1.9.2 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,5 +55,5 @@ export declare class LogService extends BaseService {
55
55
  checkTextLimit(): void;
56
56
  createDate(d?: Date): string;
57
57
  leadZero(num: number): string;
58
- createText(data: any): string;
58
+ createText(data: any, level: LOG_LEVEL): string;
59
59
  }
@@ -120,7 +120,7 @@ class LogService extends BaseService_1.BaseService {
120
120
  return;
121
121
  const msg = log.data[0];
122
122
  const optional = log.data[1];
123
- let text = this.createText(msg);
123
+ let text = this.createText(msg, log.level);
124
124
  let source = "";
125
125
  if (text.startsWith("${") && text.endsWith("}") && text.indexOf(".js") !== -1) {
126
126
  source = text.substring(2, text.length - 1);
@@ -142,7 +142,7 @@ class LogService extends BaseService_1.BaseService {
142
142
  showlog = true;
143
143
  if (optional) {
144
144
  for (let i of optional)
145
- text += ", " + this.createText(i);
145
+ text += ", " + this.createText(i, this.level);
146
146
  }
147
147
  const d = new Date();
148
148
  const logitem = {
@@ -180,7 +180,7 @@ class LogService extends BaseService_1.BaseService {
180
180
  return "0" + num;
181
181
  return num + "";
182
182
  }
183
- createText(data) {
183
+ createText(data, level) {
184
184
  if (data === null)
185
185
  return "null";
186
186
  if (data === undefined)
@@ -210,7 +210,7 @@ class LogService extends BaseService_1.BaseService {
210
210
  else {
211
211
  res = data + "";
212
212
  }
213
- if (res.length > this.options.textLimit)
213
+ if (res.length > this.options.textLimit && level === LOG_LEVEL.INFO)
214
214
  res = res.substring(0, this.options.textLimit) + "... (total: " + res.length + ")";
215
215
  return res;
216
216
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",