Skip to content

Commit 66d7f54

Browse files
authored
forward log kwargs to logger (#52)
1 parent a6933b2 commit 66d7f54

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cads_worker/worker.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ def add_stdout(
100100
if job_id is None:
101101
job_id = self.job_id
102102
if log_type == "info":
103-
self.logger.info(message, job_id=job_id)
103+
self.logger.info(message, job_id=job_id, **kwargs)
104104
if log_type == "debug":
105-
self.logger.debug(message, job_id=job_id)
105+
self.logger.debug(message, job_id=job_id, **kwargs)
106106
if log_type == "warn":
107-
self.logger.warn(message, job_id=job_id)
107+
self.logger.warn(message, job_id=job_id, **kwargs)
108108
if log_type == "warning":
109-
self.logger.warning(message, job_id=job_id)
109+
self.logger.warning(message, job_id=job_id, **kwargs)
110110
if log_type == "critical":
111-
self.logger.critical(message, job_id=job_id)
111+
self.logger.critical(message, job_id=job_id, **kwargs)
112112
if WORKER_LOGS_ON_DB:
113113
cads_broker.database.add_event(
114114
event_type=log_type,
@@ -129,9 +129,9 @@ def add_stderr(
129129
if job_id is None:
130130
job_id = self.job_id
131131
if log_type == "exception":
132-
self.logger.exception(message, job_id=job_id)
132+
self.logger.exception(message, job_id=job_id, **kwargs)
133133
if log_type == "error":
134-
self.logger.error(message, job_id=job_id)
134+
self.logger.error(message, job_id=job_id, **kwargs)
135135
if WORKER_LOGS_ON_DB:
136136
cads_broker.database.add_event(
137137
event_type=log_type,

0 commit comments

Comments
 (0)