1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function isRustError(e) {
|
4 | return typeof e.is_panic !== 'undefined';
|
5 | }
|
6 | exports.isRustError = isRustError;
|
7 | function convertLog(rustLog) {
|
8 | const isQuery = isQueryLog(rustLog.fields);
|
9 | const level = isQuery ? 'query' : rustLog.level.toLowerCase();
|
10 | return {
|
11 | ...rustLog,
|
12 | level,
|
13 | timestamp: new Date(new Date().getFullYear() + ' ' + rustLog.timestamp),
|
14 | };
|
15 | }
|
16 | exports.convertLog = convertLog;
|
17 | function isQueryLog(fields) {
|
18 | return Boolean(fields.query);
|
19 | }
|
20 |
|
\ | No newline at end of file |