fixparser-plugin-log-console 9.1.5 → 9.1.6-da9cb1d7
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/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fixparser-plugin-log-console",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.6-da9cb1d7",
|
|
4
4
|
"description": "Console / JSON logger for FIXParser",
|
|
5
|
-
"files": [
|
|
5
|
+
"files": [
|
|
6
|
+
"./build/",
|
|
7
|
+
"./types/",
|
|
8
|
+
"./LICENSE.md"
|
|
9
|
+
],
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
8
12
|
"url": "git+https://gitlab.com/logotype/fixparser.git"
|
|
@@ -20,7 +24,12 @@
|
|
|
20
24
|
"dependencies": {
|
|
21
25
|
"fixparser-common": "*"
|
|
22
26
|
},
|
|
23
|
-
"keywords": [
|
|
27
|
+
"keywords": [
|
|
28
|
+
"FIXParser",
|
|
29
|
+
"FIXParser Logger",
|
|
30
|
+
"Console Logger",
|
|
31
|
+
"Console JSON Logger"
|
|
32
|
+
],
|
|
24
33
|
"homepage": "https://fixparser.dev",
|
|
25
34
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
26
35
|
"types": "./types/ConsoleLogTransport.d.ts",
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/ConsoleLogTransport.ts
|
|
21
|
-
var ConsoleLogTransport_exports = {};
|
|
22
|
-
__export(ConsoleLogTransport_exports, {
|
|
23
|
-
ConsoleLogTransport: () => ConsoleLogTransport
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ConsoleLogTransport_exports);
|
|
26
|
-
var ConsoleLogTransport = class {
|
|
27
|
-
format;
|
|
28
|
-
constructor({ format = "json" }) {
|
|
29
|
-
this.format = format;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Configures the format for console logging (either 'console' for text or 'json').
|
|
33
|
-
*/
|
|
34
|
-
configure(config) {
|
|
35
|
-
this.format = config.format || "json";
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Sends the log message to the console in the configured format.
|
|
39
|
-
*/
|
|
40
|
-
async send(log) {
|
|
41
|
-
if (this.format === "json") {
|
|
42
|
-
console.log(JSON.stringify(log));
|
|
43
|
-
} else {
|
|
44
|
-
const { name, id, message, level, ...additionalProperties } = log;
|
|
45
|
-
const kv = Object.entries(additionalProperties).map(([key, value]) => `${key}: ${value}`);
|
|
46
|
-
let logMessage = "";
|
|
47
|
-
if (name) {
|
|
48
|
-
logMessage += `${name} `;
|
|
49
|
-
}
|
|
50
|
-
logMessage += `${id}: ${message}`;
|
|
51
|
-
console.log(logMessage, kv.join(", "));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Flushes the log buffer (if any buffering mechanism exists).
|
|
56
|
-
*/
|
|
57
|
-
async flush() {
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Closes the transport (not needed for console, but keeping the method for consistency).
|
|
61
|
-
*/
|
|
62
|
-
async close() {
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Returns the status of the transport (always "connected" for console).
|
|
66
|
-
*/
|
|
67
|
-
status() {
|
|
68
|
-
return "connected";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
ConsoleLogTransport
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=ConsoleLogTransport.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/ConsoleLogTransport.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ILogTransporter, LogMessage } from 'fixparser-common';\n\n/**\n * Logger output format options.\n *\n * - 'console': Output log in plain text format\n * - 'json': Output log in JSON format\n *\n * @public\n */\nexport type ConsoleFormat = 'console' | 'json';\n\n/**\n * A LogTransporter implementation for logging to the console.\n * It supports both text (console) and JSON formats.\n */\nexport class ConsoleLogTransport implements ILogTransporter {\n private format: ConsoleFormat;\n\n constructor({ format = 'json' }: { format: ConsoleFormat }) {\n this.format = format;\n }\n\n /**\n * Configures the format for console logging (either 'console' for text or 'json').\n */\n configure(config: { format: 'console' | 'json' }): void {\n this.format = config.format || 'json';\n }\n\n /**\n * Sends the log message to the console in the configured format.\n */\n async send(log: LogMessage): Promise<void> {\n if (this.format === 'json') {\n console.log(JSON.stringify(log));\n } else {\n const { name, id, message, level, ...additionalProperties } = log;\n const kv = Object.entries(additionalProperties).map(([key, value]) => `${key}: ${value}`);\n let logMessage = '';\n if (name) {\n logMessage += `${name} `;\n }\n logMessage += `${id}: ${message}`;\n console.log(logMessage, kv.join(', '));\n }\n }\n\n /**\n * Flushes the log buffer (if any buffering mechanism exists).\n */\n async flush(): Promise<void> {\n // No flushing needed for console transport\n }\n\n /**\n * Closes the transport (not needed for console, but keeping the method for consistency).\n */\n async close(): Promise<void> {\n // No close logic needed for console transport\n }\n\n /**\n * Returns the status of the transport (always \"connected\" for console).\n */\n status(): string {\n return 'connected';\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,sBAAN,MAAqD;AAAA,EAChD;AAAA,EAER,YAAY,EAAE,SAAS,OAAO,GAA8B;AACxD,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,QAA8C;AACpD,SAAK,SAAS,OAAO,UAAU;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,KAAK,KAAgC;AACvC,QAAI,KAAK,WAAW,QAAQ;AACxB,cAAQ,IAAI,KAAK,UAAU,GAAG,CAAC;AAAA,IACnC,OAAO;AACH,YAAM,EAAE,MAAM,IAAI,SAAS,OAAO,GAAG,qBAAqB,IAAI;AAC9D,YAAM,KAAK,OAAO,QAAQ,oBAAoB,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,GAAG,GAAG,KAAK,KAAK,EAAE;AACxF,UAAI,aAAa;AACjB,UAAI,MAAM;AACN,sBAAc,GAAG,IAAI;AAAA,MACzB;AACA,oBAAc,GAAG,EAAE,KAAK,OAAO;AAC/B,cAAQ,IAAI,YAAY,GAAG,KAAK,IAAI,CAAC;AAAA,IACzC;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAAA,EAE7B;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAAA,EAE7B;AAAA;AAAA;AAAA;AAAA,EAKA,SAAiB;AACb,WAAO;AAAA,EACX;AACJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|