used in rpc server,use clild id as server message tree id. @param ctx ctx is rpc context ,such as duboo context , please use rpc context implement Context
(Context ctx)
| 247 | * ctx is rpc context ,such as duboo context , please use rpc context implement Context |
| 248 | */ |
| 249 | public static void logRemoteCallServer(Context ctx) { |
| 250 | try { |
| 251 | MessageTree tree = TraceContextHelper.threadLocal().getMessageTree(); |
| 252 | String childId = ctx.getProperty(Context.CHILD); |
| 253 | String rootId = ctx.getProperty(Context.ROOT); |
| 254 | String parentId = ctx.getProperty(Context.PARENT); |
| 255 | |
| 256 | if (parentId != null) { |
| 257 | tree.setParentMessageId(parentId); |
| 258 | } |
| 259 | if (rootId != null) { |
| 260 | tree.setRootMessageId(rootId); |
| 261 | } |
| 262 | if (childId != null) { |
| 263 | tree.setMessageId(childId); |
| 264 | } |
| 265 | } catch (Exception e) { |
| 266 | errorHandler(e); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | public static void logTrace(String type, String name) { |
| 271 | try { |
nothing calls this directly
no test coverage detected