@digipair/skill-logger 0.66.6 → 0.66.7
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/index.cjs.js
CHANGED
@@ -77,9 +77,14 @@ let LoggerService = class LoggerService {
|
|
77
77
|
async read(params, _pinsSettingsList, context) {
|
78
78
|
var _context_privates_DIGIPAIR_LOGS_PATH, _ref;
|
79
79
|
const { date, type = 'factory', path = (_ref = (_context_privates_DIGIPAIR_LOGS_PATH = context.privates.DIGIPAIR_LOGS_PATH) != null ? _context_privates_DIGIPAIR_LOGS_PATH : process.env['DIGIPAIR_LOGS_PATH']) != null ? _ref : './factory/logs' } = params;
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
let result;
|
81
|
+
try {
|
82
|
+
const text = await fs.promises.readFile(`${path}/${type}/${date}.jsonl`, 'utf8');
|
83
|
+
const lines = text.split('\n').filter((line)=>line !== '');
|
84
|
+
result = lines.map((line)=>JSON.parse(line));
|
85
|
+
} catch (error) {
|
86
|
+
result = [];
|
87
|
+
}
|
83
88
|
return result;
|
84
89
|
}
|
85
90
|
async list(params, _pinsSettingsList, context) {
|
package/index.esm.js
CHANGED
@@ -73,9 +73,14 @@ let LoggerService = class LoggerService {
|
|
73
73
|
async read(params, _pinsSettingsList, context) {
|
74
74
|
var _context_privates_DIGIPAIR_LOGS_PATH, _ref;
|
75
75
|
const { date, type = 'factory', path = (_ref = (_context_privates_DIGIPAIR_LOGS_PATH = context.privates.DIGIPAIR_LOGS_PATH) != null ? _context_privates_DIGIPAIR_LOGS_PATH : process.env['DIGIPAIR_LOGS_PATH']) != null ? _ref : './factory/logs' } = params;
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
let result;
|
77
|
+
try {
|
78
|
+
const text = await promises.readFile(`${path}/${type}/${date}.jsonl`, 'utf8');
|
79
|
+
const lines = text.split('\n').filter((line)=>line !== '');
|
80
|
+
result = lines.map((line)=>JSON.parse(line));
|
81
|
+
} catch (error) {
|
82
|
+
result = [];
|
83
|
+
}
|
79
84
|
return result;
|
80
85
|
}
|
81
86
|
async list(params, _pinsSettingsList, context) {
|
package/package.json
CHANGED
File without changes
|
File without changes
|