Log format tweaks for sclang reprs

A space here, a newline there..
py313_support
Tyler Goodlet 2025-02-26 13:16:15 -05:00
parent 34d6e3c981
commit 2733c78eb8
5 changed files with 15 additions and 10 deletions

View File

@ -950,7 +950,7 @@ class Context:
# f'Context.cancel() => {self.chan.uid}\n'
f'c)=> {self.chan.uid}\n'
# f'{self.chan.uid}\n'
f' |_ @{self.dst_maddr}\n'
f' |_ @{self.dst_maddr}\n'
f' >> {self.repr_rpc}\n'
# f' >> {self._nsf}() -> {codec}[dict]:\n\n'
# TODO: pull msg-type from spec re #320
@ -1003,7 +1003,8 @@ class Context:
)
else:
log.cancel(
'Timed out on cancel request of remote task?\n'
f'Timed out on cancel request of remote task?\n'
f'\n'
f'{reminfo}'
)

View File

@ -238,7 +238,7 @@ def _trio_main(
nest_from_op(
input_op='>(', # see syntax ideas above
tree_str=actor_info,
back_from_op=1,
back_from_op=2, # since "complete"
)
)
logmeth = log.info

View File

@ -852,8 +852,8 @@ async def try_ship_error_to_remote(
log.critical(
'IPC transport failure -> '
f'failed to ship error to {remote_descr}!\n\n'
f'X=> {channel.uid}\n\n'
f'{type(msg)!r}[{msg.boxed_type}] X=> {channel.uid}\n'
f'\n'
# TODO: use `.msg.preetty_struct` for this!
f'{msg}\n'
)

View File

@ -1287,7 +1287,8 @@ class Actor:
msg: str = (
f'Actor-runtime cancel request from {requester_type}\n\n'
f'<=c) {requesting_uid}\n'
f' |_{self}\n'
f' |_{self}\n'
f'\n'
)
# TODO: what happens here when we self-cancel tho?
@ -1307,13 +1308,15 @@ class Actor:
lock_req_ctx.has_outcome
):
msg += (
'-> Cancelling active debugger request..\n'
f'\n'
f'-> Cancelling active debugger request..\n'
f'|_{_debug.Lock.repr()}\n\n'
f'|_{lock_req_ctx}\n\n'
)
# lock_req_ctx._scope.cancel()
# TODO: wrap this in a method-API..
debug_req.req_cs.cancel()
# if lock_req_ctx:
# self-cancel **all** ongoing RPC tasks
await self.cancel_rpc_tasks(

View File

@ -323,9 +323,10 @@ async def soft_kill(
uid: tuple[str, str] = portal.channel.uid
try:
log.cancel(
'Soft killing sub-actor via portal request\n'
f'c)> {portal.chan.uid}\n'
f' |_{proc}\n'
f'Soft killing sub-actor via portal request\n'
f'\n'
f'(c=> {portal.chan.uid}\n'
f' |_{proc}\n'
)
# wait on sub-proc to signal termination
await wait_func(proc)