1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.makeExContextLogger = exports.makeContextLogger = void 0;
|
4 | const utils_1 = require("@terascope/utils");
|
5 | function 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 | }
|
12 | exports.makeContextLogger = makeContextLogger;
|
13 | function 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 | }
|
21 | exports.makeExContextLogger = makeExContextLogger;
|
22 |
|
\ | No newline at end of file |