@@ -167,8 +167,8 @@ def __init__(self, site, node, indices):
167167 self .indices = indices
168168
169169 def fail (self , site ):
170- return log_statement (site , self .node , self .indices , "error" ,
171- mkIntegerLiteral (site , 1 ), None ,
170+ return log_statement (site , log_object ( site , self .node , self .indices ) ,
171+ "error" , mkIntegerLiteral (site , 1 ), None ,
172172 "Uncaught DML exception" )
173173
174174class ReturnFailure (Failure ):
@@ -2640,6 +2640,15 @@ def stmt_log(stmt, location, scope):
26402640 else :
26412641 warn_mixup = probable_loggroups_specification (level )
26422642
2643+ # Acquire a subsequent log key and the logging object based on obj or trait
2644+ # identity
2645+ if location .method ():
2646+ identity = ObjIdentity (site , location .node .parent , location .indices )
2647+ logobj = log_object (site , location .node , location .indices )
2648+ else :
2649+ identity = TraitObjIdentity (site , lookup_var (site , scope , "this" ))
2650+ logobj = LogObjectFromObjIdentity (site , identity )
2651+
26432652 if later_level is not None :
26442653 adjusted_later_level = later_level = ctree .as_int (codegen_expression (
26452654 later_level , location , scope ))
@@ -2654,14 +2663,10 @@ def stmt_log(stmt, location, scope):
26542663 global log_index
26552664 table_ptr = TPtr (TNamed ("ht_int_table_t" ))
26562665 table = mkLit (site , '&(_dev->_subsequent_log_ht)' , table_ptr )
2657- # Acquire a key based on obj or trait identity
2658- if location .method ():
2659- identity = ObjIdentity (site , location .node .parent , location .indices )
2660- else :
2661- identity = TraitObjIdentity (site , lookup_var (site , scope , "this" ))
26622666 key = mkApply (site ,
26632667 mkLit (site , "_identity_to_key" ,
2664- TFunction ([TNamed ('_identity_t' )], TInt (64 , False ))),
2668+ TFunction ([TNamed ('_identity_t' )],
2669+ TInt (64 , False ))),
26652670 [identity ])
26662671
26672672 once_lookup = mkLit (
@@ -2690,8 +2695,8 @@ def stmt_log(stmt, location, scope):
26902695 report (WLOGMIXUP (site , logkind , level , later_level , groups ))
26912696 fmt , args = fix_printf (fmt , args , argsites , site )
26922697 return [mkCompound (site , pre_statements + [
2693- log_statement (site , location . node , location . indices ,
2694- logkind , adjusted_level , groups , fmt , * args )])]
2698+ log_statement (site , logobj , logkind , adjusted_level , groups , fmt ,
2699+ * args )])]
26952700@statement_dispatcher
26962701def stmt_try (stmt , location , scope ):
26972702 [tryblock , excblock ] = stmt .args
0 commit comments