Skip to content

Commit

Permalink
log by last task details (#1569)
Browse files Browse the repository at this point in the history
* log by last task details

* add all logging info

* typo

* Debug logging same as wrapper
  • Loading branch information
Golan Hallel authored Mar 30, 2022
1 parent 06fd064 commit cdbcf04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/algorithm-debug/config/logger/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config.transport = {
config.console = {
json: false,
colors: false,
format: 'wrapper::{level}::{message}',
level: process.env.HKUBE_LOG_LEVEL,
};
config.file = {
Expand Down
10 changes: 6 additions & 4 deletions core/worker/lib/consumer/JobConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class JobConsumer extends EventEmitter {
this._job = null;
this._jobId = undefined;
this._taskId = undefined;
this._loggingInfo = {};
this._nodeName = undefined;
this._batchIndex = undefined;
this._pipelineName = undefined;
Expand Down Expand Up @@ -130,6 +131,7 @@ class JobConsumer extends EventEmitter {
this._job = job;
this._kind = job.data.kind;
this._jobId = job.data.jobId;
this._loggingInfo = { jobId: job.data.jobId, taskId: job.data.taskId, pipelineName: job.data.pipelineName, batchIndex: job.data.batchIndex };
this._taskId = job.data.taskId;
this._execId = job.data.execId;
this._nodeName = job.data.nodeName;
Expand Down Expand Up @@ -325,11 +327,11 @@ class JobConsumer extends EventEmitter {

currentTaskInfo() {
return {
jobId: this._jobId,
taskId: this._taskId,
pipelineName: this._pipelineName,
jobId: this._loggingInfo.jobId,
taskId: this._loggingInfo.taskId,
pipelineName: this._loggingInfo.pipelineName,
algorithmName: this.getAlgorithmType(),
batchIndex: this._batchIndex
batchIndex: this._loggingInfo.batchIndex
};
}

Expand Down

0 comments on commit cdbcf04

Please sign in to comment.