@@ -1278,7 +1278,7 @@ package body GNATCOLL.Traces is
12781278 end if ;
12791279
12801280 if Global.Location.Active then
1281- Msg.Append (" (loc: " );
1281+ Msg.Append (" (loc:" );
12821282 Msg.Append (Location);
12831283 Msg.Append (' )' );
12841284 end if ;
@@ -2178,15 +2178,23 @@ package body GNATCOLL.Traces is
21782178 if Active (Handle) then
21792179 Result.Me := Handle;
21802180 Result.Style := Style;
2181- Result.Loc := new String'(Entity & ' :' & Location);
2181+ Result.Location := new String'(Location);
2182+ Result.Entity := new String'(Entity);
2183+
2184+ -- To ensure consistency between all traces, location and entity
2185+ -- are also displayed in the loc and entity fields of the message,
2186+ -- despite this piece of information already being contained in
2187+ -- the first part of the message.
2188+
21822189 if Message /= " " then
21832190 Increase_Indent
2184- (Handle, " Entering " & Result.Loc.all & ' ' & Message,
2185- Style => Style, Location => " " , Entity => " " );
2191+ (Handle,
2192+ " Entering " & Entity & ' :' & Location & ' ' & Message,
2193+ Style => Style, Location => Location, Entity => Entity);
21862194 else
21872195 Increase_Indent
2188- (Handle, " Entering " & Result.Loc. all ,
2189- Style => Style, Location => " " , Entity => " " );
2196+ (Handle, " Entering " & Entity & ' : ' & Location ,
2197+ Style => Style, Location => Location , Entity => Entity );
21902198 end if ;
21912199 end if ;
21922200 end return ;
@@ -2200,13 +2208,21 @@ package body GNATCOLL.Traces is
22002208 begin
22012209 -- If we were active when Create was called
22022210 if Self.Me /= null then
2211+
2212+ -- To ensure consistency between all traces, location and entity
2213+ -- are also displayed in the loc and entity fields of the message,
2214+ -- despite this piece of information already being contained in
2215+ -- the first part of the message.
2216+
22032217 Decrease_Indent
2204- (Self.Me, " Leaving " & Self.Loc .all ,
2218+ (Self.Me, " Leaving " & Self.Entity. all & ' : ' & Self.Location .all ,
22052219 Style => Self.Style,
2206- Location => " " , -- avoid duplicate info in the output
2207- Entity => " " );
2220+ Location => Self.Location. all ,
2221+ Entity => Self.Entity. all );
22082222 end if ;
2209- Free (Self.Loc);
2223+
2224+ Free (Self.Location);
2225+ Free (Self.Entity);
22102226 end Finalize ;
22112227
22122228end GNATCOLL.Traces ;
0 commit comments