UNPKG

853 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.makeExContextLogger = exports.makeContextLogger = void 0;
4const utils_1 = require("@terascope/utils");
5function makeContextLogger(context, moduleName, extra = {}) {
6 return context.apis.foundation.makeLogger(Object.assign({
7 module: moduleName,
8 worker_id: utils_1.get(context, 'cluster.worker.id'),
9 assignment: utils_1.get(context, 'assignment'),
10 }, extra));
11}
12exports.makeContextLogger = makeContextLogger;
13function makeExContextLogger(context, config, moduleName, extra = {}) {
14 const { ex_id: exId, job_id: jobId } = config;
15 return makeContextLogger(context, moduleName, {
16 ex_id: exId,
17 job_id: jobId,
18 ...extra
19 });
20}
21exports.makeExContextLogger = makeExContextLogger;
22//# sourceMappingURL=utils.js.map
\No newline at end of file