nightingale-formatter 14.2.1 → 15.0.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [15.0.0](https://github.com/christophehurpeau/nightingale/compare/v14.2.1...v15.0.0) (2023-12-25)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * update babel and drop browser modern version
12
+
13
+ ### Features
14
+
15
+ * update babel and drop browser modern version ([5c76abc](https://github.com/christophehurpeau/nightingale/commit/5c76abc8bfb595a617fc4c8b795dae7e674ea664))
16
+
17
+ Version bump for dependency: nightingale-levels
18
+ Version bump for dependency: nightingale-types
19
+
20
+
6
21
  ## [14.2.1](https://github.com/christophehurpeau/nightingale/compare/v14.2.0...v14.2.1) (2023-11-05)
7
22
 
8
23
  Note: no notable changes
@@ -1,19 +1,34 @@
1
1
  import { Level } from 'nightingale-levels';
2
- import _extends from '@babel/runtime/helpers/esm/extends';
3
2
 
4
- var _levelToStyles;
5
- var levelToStyles = (_levelToStyles = {}, _levelToStyles[Level.TRACE] = ['gray'], _levelToStyles[Level.DEBUG] = ['gray'], _levelToStyles[Level.WARN] = ['yellow'], _levelToStyles[Level.ERROR] = ['red', 'bold'], _levelToStyles[Level.CRITICAL] = ['red', 'bold'], _levelToStyles[Level.FATAL] = ['bgRed', 'white'], _levelToStyles[Level.EMERGENCY] = ['bgRed', 'white'], _levelToStyles);
3
+ const levelToStyles = {
4
+ [Level.TRACE]: ['gray'],
5
+ [Level.DEBUG]: ['gray'],
6
+ // [Level.INFO]: ['gray'],
7
+ [Level.WARN]: ['yellow'],
8
+ [Level.ERROR]: ['red', 'bold'],
9
+ [Level.CRITICAL]: ['red', 'bold'],
10
+ [Level.FATAL]: ['bgRed', 'white'],
11
+ [Level.EMERGENCY]: ['bgRed', 'white']
12
+ };
6
13
 
7
- var _levelToSymbol;
8
- var levelToSymbol = (_levelToSymbol = {}, _levelToSymbol[Level.TRACE] = '•', _levelToSymbol[Level.DEBUG] = '•', _levelToSymbol[Level.INFO] = '→', _levelToSymbol[Level.WARN] = '⚠', _levelToSymbol[Level.ERROR] = '✖', _levelToSymbol[Level.CRITICAL] = '!', _levelToSymbol[Level.FATAL] = '‼', _levelToSymbol[Level.EMERGENCY] = '‼', _levelToSymbol);
14
+ const levelToSymbol = {
15
+ [Level.TRACE]: '•',
16
+ [Level.DEBUG]: '•',
17
+ [Level.INFO]: '→',
18
+ [Level.WARN]: '⚠',
19
+ [Level.ERROR]: '✖',
20
+ [Level.CRITICAL]: '!',
21
+ [Level.FATAL]: '‼',
22
+ [Level.EMERGENCY]: '‼'
23
+ };
9
24
 
10
- var styleToHexColor = {
25
+ const styleToHexColor = {
11
26
  orange: 'ff5f00',
12
27
  grayLight: '808080',
13
28
  'gray-light': '808080'
14
29
  };
15
30
 
16
- var styleToHtmlStyleThemeLight = {
31
+ const styleToHtmlStyleThemeLight = {
17
32
  // text style
18
33
  bold: {
19
34
  open: 'font-weight: bold',
@@ -104,19 +119,20 @@ var styleToHtmlStyleThemeLight = {
104
119
  close: 'background: initial'
105
120
  },
106
121
  orange: {
107
- open: "color: #" + styleToHexColor.orange,
122
+ open: `color: #${styleToHexColor.orange}`,
108
123
  close: 'color: currentcolor'
109
124
  },
110
125
  grayLight: {
111
- open: "color: #" + styleToHexColor.grayLight,
126
+ open: `color: #${styleToHexColor.grayLight}`,
112
127
  close: 'color: currentcolor'
113
128
  },
114
129
  'gray-light': {
115
- open: "color: #" + styleToHexColor.grayLight,
130
+ open: `color: #${styleToHexColor.grayLight}`,
116
131
  close: 'color: currentcolor'
117
132
  }
118
133
  };
119
- var styleToHtmlStyleThemeDark = _extends({}, styleToHtmlStyleThemeLight, {
134
+ const styleToHtmlStyleThemeDark = {
135
+ ...styleToHtmlStyleThemeLight,
120
136
  black: styleToHtmlStyleThemeLight.white,
121
137
  bgBlack: styleToHtmlStyleThemeLight.bgWhite,
122
138
  white: styleToHtmlStyleThemeLight.black,
@@ -125,35 +141,29 @@ var styleToHtmlStyleThemeDark = _extends({}, styleToHtmlStyleThemeLight, {
125
141
  open: 'color: lightgray',
126
142
  close: 'color: currentcolor'
127
143
  }
128
- });
144
+ };
129
145
 
130
146
  /* eslint-disable max-lines, @typescript-eslint/no-use-before-define */
131
147
 
132
- var noStyleFn = function noStyleFn(styles, value) {
133
- return value;
134
- };
148
+ const noStyleFn = (styles, value) => value;
135
149
  function tryStringify(arg) {
136
150
  try {
137
151
  return JSON.stringify(arg).replace(/\\n/g, '\n');
138
- } catch (_unused) {
152
+ } catch {
139
153
  return '[Circular]';
140
154
  }
141
155
  }
142
- var sameRawFormattedValue = function sameRawFormattedValue(value) {
143
- return {
144
- stringValue: value,
145
- formattedValue: value
146
- };
147
- };
148
- function internalFormatValue(value, styleFn, styles, _ref) {
149
- var padding = _ref.padding,
150
- depth = _ref.depth,
151
- maxDepth = _ref.maxDepth,
152
- objects = _ref.objects,
153
- stack,
154
- name,
155
- _name;
156
- var typeofValue = typeof value;
156
+ const sameRawFormattedValue = value => ({
157
+ stringValue: value,
158
+ formattedValue: value
159
+ });
160
+ function internalFormatValue(value, styleFn, styles, {
161
+ padding,
162
+ depth,
163
+ maxDepth,
164
+ objects
165
+ }) {
166
+ const typeofValue = typeof value;
157
167
  if (!styles) {
158
168
  if (value == null) {
159
169
  styles = ['cyan'];
@@ -180,7 +190,7 @@ function internalFormatValue(value, styleFn, styles, _ref) {
180
190
  }
181
191
  }
182
192
  }
183
- var stringValue;
193
+ let stringValue;
184
194
  if (value === null) {
185
195
  stringValue = 'null';
186
196
  } else if (value === undefined) {
@@ -193,10 +203,10 @@ function internalFormatValue(value, styleFn, styles, _ref) {
193
203
  stringValue = '{Object...}';
194
204
  } else {
195
205
  return internalFormatObject(value, styleFn, undefined, {
196
- padding: padding,
206
+ padding,
197
207
  depth: depth + 1,
198
- maxDepth: maxDepth,
199
- objects: objects
208
+ maxDepth,
209
+ objects
200
210
  });
201
211
  }
202
212
  } else if (Array.isArray(value)) {
@@ -204,25 +214,25 @@ function internalFormatValue(value, styleFn, styles, _ref) {
204
214
  stringValue = '[Array...]';
205
215
  } else {
206
216
  return internalFormatArray(value, styleFn, {
207
- padding: padding,
217
+ padding,
208
218
  depth: depth + 1,
209
- maxDepth: maxDepth,
210
- objects: objects
219
+ maxDepth,
220
+ objects
211
221
  });
212
222
  }
213
223
  } else if (value instanceof Error) {
214
- stack = value.stack;
215
- stringValue = stack != null && stack.startsWith(value.message) || stack != null && stack.startsWith(value.name + ": " + value.message) ? stack : value.message + "\n" + (stack || '');
224
+ const stack = value.stack;
225
+ stringValue = stack != null && stack.startsWith(value.message) || stack != null && stack.startsWith(`${value.name}: ${value.message}`) ? stack : `${value.message}\n${stack || ''}`;
216
226
  } else if (value instanceof Map) {
217
- name = value.constructor.name;
227
+ const name = value.constructor.name;
218
228
  if (depth >= maxDepth) {
219
- stringValue = "{" + name + "...}";
229
+ stringValue = `{${name}...}`;
220
230
  } else {
221
231
  return internalFormatMap(name, value, styleFn, {
222
- padding: padding,
232
+ padding,
223
233
  depth: depth + 1,
224
- maxDepth: maxDepth,
225
- objects: objects
234
+ maxDepth,
235
+ objects
226
236
  });
227
237
  }
228
238
  } else if (typeofValue === 'bigint') {
@@ -230,15 +240,15 @@ function internalFormatValue(value, styleFn, styles, _ref) {
230
240
  } else if (typeofValue === 'symbol') {
231
241
  stringValue = value.toString();
232
242
  } else if (value instanceof Set) {
233
- _name = value.constructor.name;
243
+ const name = value.constructor.name;
234
244
  if (depth >= maxDepth) {
235
- stringValue = "{" + _name + "...}";
245
+ stringValue = `{${name}...}`;
236
246
  } else {
237
- return internalFormatSet(_name, value, styleFn, {
238
- padding: padding,
247
+ return internalFormatSet(name, value, styleFn, {
248
+ padding,
239
249
  depth: depth + 1,
240
- maxDepth: maxDepth,
241
- objects: objects
250
+ maxDepth,
251
+ objects
242
252
  });
243
253
  }
244
254
  } else if (value instanceof WeakMap) {
@@ -248,70 +258,73 @@ function internalFormatValue(value, styleFn, styles, _ref) {
248
258
  } else {
249
259
  stringValue = tryStringify(value);
250
260
  }
251
- var formattedValue = styleFn(styles, stringValue);
261
+ const formattedValue = styleFn(styles, stringValue);
252
262
  return {
253
- stringValue: stringValue,
254
- formattedValue: formattedValue
263
+ stringValue,
264
+ formattedValue
255
265
  };
256
266
  }
257
- var separator = ',';
258
- var internalFormatKey = function internalFormatKey(key, styleFn) {
267
+ const separator = ',';
268
+ const internalFormatKey = (key, styleFn) => {
259
269
  return {
260
- stringKey: key + ": ",
261
- formattedKey: styleFn(['gray-light', 'bold'], key + ":") + " "
270
+ stringKey: `${key}: `,
271
+ formattedKey: `${styleFn(['gray-light', 'bold'], `${key}:`)} `
262
272
  };
263
273
  };
264
- var internalNoKey = function internalNoKey() {
274
+ const internalNoKey = () => {
265
275
  return {
266
276
  stringKey: '',
267
277
  formattedKey: ''
268
278
  };
269
279
  };
270
- var internalFormatMapKey = function internalFormatMapKey(key, styleFn, internalFormatParams) {
271
- var _internalFormatValue = internalFormatValue(key, noStyleFn, undefined, internalFormatParams),
272
- stringValue = _internalFormatValue.stringValue,
273
- formattedValue = _internalFormatValue.formattedValue;
280
+ const internalFormatMapKey = (key, styleFn, internalFormatParams) => {
281
+ const {
282
+ stringValue,
283
+ formattedValue
284
+ } = internalFormatValue(key, noStyleFn, undefined, internalFormatParams);
274
285
  return {
275
- stringKey: stringValue + " => ",
276
- formattedKey: styleFn(['gray-light', 'bold'], formattedValue + ":") + " "
286
+ stringKey: `${stringValue} => `,
287
+ formattedKey: `${styleFn(['gray-light', 'bold'], `${formattedValue}:`)} `
277
288
  };
278
289
  };
279
- var internalFormatIterator = function internalFormatIterator(values, styleFn, objectStyles, _ref2, _ref3) {
280
- var padding = _ref2.padding,
281
- depth = _ref2.depth,
282
- maxDepth = _ref2.maxDepth,
283
- objects = _ref2.objects;
284
- var prefix = _ref3.prefix,
285
- suffix = _ref3.suffix,
286
- _ref3$prefixSuffixSpa = _ref3.prefixSuffixSpace,
287
- prefixSuffixSpace = _ref3$prefixSuffixSpa === void 0 ? ' ' : _ref3$prefixSuffixSpa,
288
- formatKey = _ref3.formatKey;
289
- var breakLine = false;
290
- var formattedSeparator = function formattedSeparator() {
291
- return styleFn(['gray'], separator);
292
- };
293
- var valuesMaxIndex = values.length - 1;
294
- var formattedValues = values.map(function (_ref4, index) {
295
- var key = _ref4.key,
296
- value = _ref4.value;
297
- var internalFormatParams = {
298
- padding: padding,
290
+ const internalFormatIterator = (values, styleFn, objectStyles, {
291
+ padding,
292
+ depth,
293
+ maxDepth,
294
+ objects
295
+ }, {
296
+ prefix,
297
+ suffix,
298
+ prefixSuffixSpace = ' ',
299
+ formatKey
300
+ }) => {
301
+ let breakLine = false;
302
+ const formattedSeparator = () => styleFn(['gray'], separator);
303
+ const valuesMaxIndex = values.length - 1;
304
+ const formattedValues = values.map(({
305
+ key,
306
+ value
307
+ }, index) => {
308
+ const internalFormatParams = {
309
+ padding,
299
310
  depth: depth + 1,
300
- maxDepth: maxDepth,
301
- objects: objects
311
+ maxDepth,
312
+ objects
302
313
  };
303
314
 
304
315
  // key must be formatted before value (browser-formatter needs order)
305
- var _formatKey = formatKey(key, styleFn, internalFormatParams),
306
- stringKey = _formatKey.stringKey,
307
- formattedKey = _formatKey.formattedKey;
308
- var _internalFormatValue2 = internalFormatValue(value, styleFn, key && objectStyles ? objectStyles[key] : undefined, internalFormatParams),
309
- stringValue = _internalFormatValue2.stringValue,
310
- formattedValue = _internalFormatValue2.formattedValue;
316
+ const {
317
+ stringKey,
318
+ formattedKey
319
+ } = formatKey(key, styleFn, internalFormatParams);
320
+ let {
321
+ stringValue,
322
+ formattedValue
323
+ } = internalFormatValue(value, styleFn, key && objectStyles ? objectStyles[key] : undefined, internalFormatParams);
311
324
  if (stringValue && (stringValue.length > 80 || stringValue.includes('\n'))) {
312
325
  breakLine = true;
313
- stringValue = stringValue.replace(/\n/g, "\n" + padding);
314
- formattedValue = formattedValue.replace(/\n/g, "\n" + padding);
326
+ stringValue = stringValue.replace(/\n/g, `\n${padding}`);
327
+ formattedValue = formattedValue.replace(/\n/g, `\n${padding}`);
315
328
  }
316
329
  return {
317
330
  stringValue: stringKey + stringValue + (index === valuesMaxIndex ? '' : separator),
@@ -319,43 +332,33 @@ var internalFormatIterator = function internalFormatIterator(values, styleFn, ob
319
332
  // note: we need to format the separator for each values for browser-formatter
320
333
  };
321
334
  });
322
-
323
335
  return {
324
- stringValue: prefix + formattedValues.map(breakLine ? function (v) {
325
- return "\n" + padding + v.stringValue;
326
- } : function (fv) {
327
- return fv.stringValue;
328
- }).join(breakLine ? '\n' : ' ') + suffix,
329
- formattedValue: "" + prefix + (breakLine ? '' : prefixSuffixSpace) + formattedValues.map(breakLine ? function (v) {
330
- return "\n" + padding + v.formattedValue;
331
- } : function (v) {
332
- return v.formattedValue;
333
- }).join(breakLine ? '' : ' ') + (breakLine ? ',\n' : prefixSuffixSpace) + suffix
336
+ stringValue: prefix + formattedValues.map(breakLine ? v => `\n${padding}${v.stringValue}` : fv => fv.stringValue).join(breakLine ? '\n' : ' ') + suffix,
337
+ formattedValue: `${prefix}${breakLine ? '' : prefixSuffixSpace}${formattedValues.map(breakLine ? v => `\n${padding}${v.formattedValue}` : v => v.formattedValue).join(breakLine ? '' : ' ')}${breakLine ? ',\n' : prefixSuffixSpace}${suffix}`
334
338
  };
335
339
  };
336
- function internalFormatObject(object, styleFn, objectStyles, _ref5) {
337
- var padding = _ref5.padding,
338
- depth = _ref5.depth,
339
- maxDepth = _ref5.maxDepth,
340
- objects = _ref5.objects;
340
+ function internalFormatObject(object, styleFn, objectStyles, {
341
+ padding,
342
+ depth,
343
+ maxDepth,
344
+ objects
345
+ }) {
341
346
  if (objects.has(object)) {
342
347
  return sameRawFormattedValue('{Circular Object}');
343
348
  }
344
- var keys = Object.keys(object);
349
+ const keys = Object.keys(object);
345
350
  if (keys.length === 0) {
346
351
  return sameRawFormattedValue('{}');
347
352
  }
348
353
  objects.add(object);
349
- var result = internalFormatIterator(keys.map(function (key) {
350
- return {
351
- key: key,
352
- value: object[key]
353
- };
354
- }), styleFn, objectStyles, {
355
- padding: padding,
356
- depth: depth,
357
- maxDepth: maxDepth,
358
- objects: objects
354
+ const result = internalFormatIterator(keys.map(key => ({
355
+ key,
356
+ value: object[key]
357
+ })), styleFn, objectStyles, {
358
+ padding,
359
+ depth,
360
+ maxDepth,
361
+ objects
359
362
  }, {
360
363
  prefix: '{',
361
364
  suffix: '}',
@@ -364,42 +367,42 @@ function internalFormatObject(object, styleFn, objectStyles, _ref5) {
364
367
  objects.delete(object);
365
368
  return result;
366
369
  }
367
- function internalFormatMap(name, map, styleFn, _ref6) {
368
- var padding = _ref6.padding,
369
- depth = _ref6.depth,
370
- maxDepth = _ref6.maxDepth,
371
- objects = _ref6.objects;
370
+ function internalFormatMap(name, map, styleFn, {
371
+ padding,
372
+ depth,
373
+ maxDepth,
374
+ objects
375
+ }) {
372
376
  if (objects.has(map)) {
373
- return sameRawFormattedValue("{Circular " + name + "}");
377
+ return sameRawFormattedValue(`{Circular ${name}}`);
374
378
  }
375
- var keys = [].concat(map.keys());
379
+ const keys = [...map.keys()];
376
380
  if (keys.length === 0) {
377
- return sameRawFormattedValue(name + " {}");
381
+ return sameRawFormattedValue(`${name} {}`);
378
382
  }
379
383
  objects.add(map);
380
- var result = internalFormatIterator(keys.map(function (key) {
381
- return {
382
- key: key,
383
- value: map.get(key)
384
- };
385
- }), styleFn, undefined, {
386
- padding: padding,
387
- depth: depth,
388
- maxDepth: maxDepth,
389
- objects: objects
384
+ const result = internalFormatIterator(keys.map(key => ({
385
+ key,
386
+ value: map.get(key)
387
+ })), styleFn, undefined, {
388
+ padding,
389
+ depth,
390
+ maxDepth,
391
+ objects
390
392
  }, {
391
- prefix: name + " {",
393
+ prefix: `${name} {`,
392
394
  suffix: '}',
393
395
  formatKey: internalFormatMapKey
394
396
  });
395
397
  objects.delete(map);
396
398
  return result;
397
399
  }
398
- function internalFormatArray(array, styleFn, _ref7) {
399
- var padding = _ref7.padding,
400
- depth = _ref7.depth,
401
- maxDepth = _ref7.maxDepth,
402
- objects = _ref7.objects;
400
+ function internalFormatArray(array, styleFn, {
401
+ padding,
402
+ depth,
403
+ maxDepth,
404
+ objects
405
+ }) {
403
406
  if (objects.has(array)) {
404
407
  return sameRawFormattedValue('{Circular Array}');
405
408
  }
@@ -407,16 +410,14 @@ function internalFormatArray(array, styleFn, _ref7) {
407
410
  return sameRawFormattedValue('[]');
408
411
  }
409
412
  objects.add(array);
410
- var result = internalFormatIterator(array.map(function (value) {
411
- return {
412
- key: undefined,
413
- value: value
414
- };
415
- }), styleFn, undefined, {
416
- padding: padding,
417
- depth: depth,
418
- maxDepth: maxDepth,
419
- objects: objects
413
+ const result = internalFormatIterator(array.map(value => ({
414
+ key: undefined,
415
+ value
416
+ })), styleFn, undefined, {
417
+ padding,
418
+ depth,
419
+ maxDepth,
420
+ objects
420
421
  }, {
421
422
  prefix: '[',
422
423
  suffix: ']',
@@ -426,53 +427,48 @@ function internalFormatArray(array, styleFn, _ref7) {
426
427
  objects.delete(array);
427
428
  return result;
428
429
  }
429
- function internalFormatSet(name, set, styleFn, _ref8) {
430
- var padding = _ref8.padding,
431
- depth = _ref8.depth,
432
- maxDepth = _ref8.maxDepth,
433
- objects = _ref8.objects;
430
+ function internalFormatSet(name, set, styleFn, {
431
+ padding,
432
+ depth,
433
+ maxDepth,
434
+ objects
435
+ }) {
434
436
  if (objects.has(set)) {
435
- return sameRawFormattedValue("{Circular " + name + "}");
437
+ return sameRawFormattedValue(`{Circular ${name}}`);
436
438
  }
437
- var values = [].concat(set.values());
439
+ const values = [...set.values()];
438
440
  if (values.length === 0) {
439
- return sameRawFormattedValue(name + " []");
441
+ return sameRawFormattedValue(`${name} []`);
440
442
  }
441
443
  objects.add(set);
442
- var result = internalFormatIterator(values.map(function (value) {
443
- return {
444
- key: undefined,
445
- value: value
446
- };
447
- }), styleFn, undefined, {
448
- padding: padding,
449
- depth: depth,
450
- maxDepth: maxDepth,
451
- objects: objects
444
+ const result = internalFormatIterator(values.map(value => ({
445
+ key: undefined,
446
+ value
447
+ })), styleFn, undefined, {
448
+ padding,
449
+ depth,
450
+ maxDepth,
451
+ objects
452
452
  }, {
453
- prefix: name + " [",
453
+ prefix: `${name} [`,
454
454
  suffix: ']',
455
455
  formatKey: internalNoKey
456
456
  });
457
457
  objects.delete(set);
458
458
  return result;
459
459
  }
460
- function formatObject(object, styleFn, objectStyles, _temp) {
461
- if (styleFn === void 0) {
462
- styleFn = noStyleFn;
463
- }
464
- var _ref9 = _temp === void 0 ? {} : _temp,
465
- _ref9$padding = _ref9.padding,
466
- padding = _ref9$padding === void 0 ? ' ' : _ref9$padding,
467
- _ref9$maxDepth = _ref9.maxDepth,
468
- maxDepth = _ref9$maxDepth === void 0 ? 10 : _ref9$maxDepth;
469
- var _internalFormatObject = internalFormatObject(object, styleFn, objectStyles, {
470
- padding: padding,
471
- maxDepth: maxDepth,
472
- depth: 0,
473
- objects: new Set()
474
- }),
475
- result = _internalFormatObject.formattedValue;
460
+ function formatObject(object, styleFn = noStyleFn, objectStyles, {
461
+ padding = ' ',
462
+ maxDepth = 10
463
+ } = {}) {
464
+ const {
465
+ formattedValue: result
466
+ } = internalFormatObject(object, styleFn, objectStyles, {
467
+ padding,
468
+ maxDepth,
469
+ depth: 0,
470
+ objects: new Set()
471
+ });
476
472
  if (result === '{}') {
477
473
  return '';
478
474
  }
@@ -480,7 +476,7 @@ function formatObject(object, styleFn, objectStyles, _temp) {
480
476
  }
481
477
 
482
478
  function formatRecordToString(record, style) {
483
- var parts = [];
479
+ const parts = [];
484
480
  if (record.displayName) {
485
481
  parts.push(style(['gray-light'], record.displayName));
486
482
  } else if (record.key) {
@@ -490,12 +486,11 @@ function formatRecordToString(record, style) {
490
486
  parts.push(style(['gray', 'bold'], record.datetime.toTimeString().split(' ')[0]));
491
487
  /* new Date().toFormat('HH24:MI:SS') */
492
488
  }
493
-
494
- var message = record.symbol || levelToSymbol[record.level];
495
- var styles = record.styles || levelToStyles[record.level];
489
+ let message = record.symbol || levelToSymbol[record.level];
490
+ const styles = record.styles || levelToStyles[record.level];
496
491
  if (record.message) {
497
492
  if (message) {
498
- message += " " + record.message;
493
+ message += ` ${record.message}`;
499
494
  } else {
500
495
  message = record.message;
501
496
  }
@@ -506,11 +501,11 @@ function formatRecordToString(record, style) {
506
501
  }
507
502
  parts.push(message);
508
503
  }
509
- var formatRecordObject = function formatRecordObject(key, object, objectStyles) {
504
+ const formatRecordObject = (key, object, objectStyles) => {
510
505
  if (!object) {
511
506
  return;
512
507
  }
513
- var stringObject = formatObject(object, style, objectStyles);
508
+ const stringObject = formatObject(object, style, objectStyles);
514
509
  if (!stringObject) {
515
510
  return;
516
511
  }