1111import warnings
1212from abc import ABC , abstractmethod
1313from contextlib import contextmanager
14- from dataclasses import asdict , dataclass
14+ from dataclasses import dataclass
1515from datetime import datetime , timedelta , timezone
1616from enum import Enum , IntEnum
1717from functools import partial
@@ -1213,10 +1213,6 @@ class LoggerAdapter(logging.LoggerAdapter):
12131213 dictionary value will be added to the ``extra`` dictionary with some
12141214 workflow info, making it present on the ``LogRecord.__dict__`` for
12151215 use by others. Default is True.
1216- update_info_on_extra: Boolean for whether a ``temporal_update``
1217- dictionary value will be added to the ``extra`` dictionary with some
1218- update info, making it present on the ``LogRecord.__dict__`` for use
1219- by others. Default is True.
12201216 full_workflow_info_on_extra: Boolean for whether a ``workflow_info``
12211217 value will be added to the ``extra`` dictionary with the entire
12221218 workflow info, making it present on the ``LogRecord.__dict__`` for
@@ -1236,7 +1232,6 @@ def __init__(
12361232 super ().__init__ (logger , extra or {})
12371233 self .workflow_info_on_message = True
12381234 self .workflow_info_on_extra = True
1239- self .update_info_on_extra = True
12401235 self .full_workflow_info_on_extra = False
12411236 self .log_during_replay = False
12421237
@@ -1247,25 +1242,26 @@ def process(
12471242 if (
12481243 self .workflow_info_on_message
12491244 or self .workflow_info_on_extra
1250- or self .update_info_on_extra
12511245 or self .full_workflow_info_on_extra
12521246 ):
12531247 extra : Dict [str , Any ] = {}
12541248 msg_extra : Dict [str , Any ] = {}
12551249 runtime = _Runtime .maybe_current ()
12561250 if runtime :
1251+ workflow_details = runtime .logger_details
12571252 if self .workflow_info_on_message :
1258- msg_extra .update (runtime . logger_details )
1253+ msg_extra .update (workflow_details )
12591254 if self .workflow_info_on_extra :
1260- extra ["temporal_workflow" ] = runtime . logger_details
1255+ extra ["temporal_workflow" ] = workflow_details
12611256 if self .full_workflow_info_on_extra :
12621257 extra ["workflow_info" ] = runtime .workflow_info ()
12631258 update_info = current_update_info ()
12641259 if update_info :
1265- if self .update_info_on_extra :
1266- extra ["temporal_update" ] = asdict (update_info )
1260+ update_details = update_info .logger_details
1261+ if self .workflow_info_on_extra :
1262+ extra .setdefault ("temporal_workflow" , {}).update (update_details )
12671263 if self .workflow_info_on_message :
1268- msg_extra .update (update_info . logger_details )
1264+ msg_extra .update (update_details )
12691265
12701266 kwargs ["extra" ] = {** extra , ** (kwargs .get ("extra" ) or {})}
12711267 if msg_extra :
0 commit comments