tractor/tractor
Tyler Goodlet 54ee624632 Implicitly name sub-logs by caller's mod
That is when no `name` is passed to `get_logger()`, try to introspect
the caller's `module.__name__` and use it to infer/get the "namespace
path" to that module the same as if using `name=__name__` as in the most
common usage.

Further, change the `_root_name` to be `pkg_name: str`, a public and
more obvious param name, and deprecate the former. This obviously adds
the necessary impl to make the new
`test_sys_log::test_implicit_mod_name_applied_for_child` test pass.

Impl detalles for `get_logger()`,
- add `pkg_name` and deprecate `_root_name`, include failover logic
  and a warning.
- implement calling module introspection using
  `inspect.stack()/getmodule()` to get both the `.__name__` and
  `.__package__` info alongside adjusted logic to set the `name`
  when not provided but only when a new `mk_sublog: bool` is set.
- tweak the `name` processing for implicitly set case,
  - rename `sub_name` -> `pkg_path: str` which is the path
    to the calling module minus that module's name component.
  - only partition `name` if `pkg_name` is `in` it.
  - use the `_root_log` for `pkg_name` duplication warnings.

Other/related,
- add types to various public mod vars missing them.
- rename `.log.log` -> `.log._root_log`.
2025-09-11 17:05:35 -04:00
..
_testing Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-07-14 00:00:12 -04:00
devx Heh, add back `Actor._root_tn`, it has purpose.. 2025-08-20 10:18:52 -04:00
experimental Add API-modernize-todo on `experimental._pubsub.fan_out_to_ctxs` 2025-07-08 18:05:05 -04:00
ipc Always pass a `tn` to `._server._serve_ipc_eps()` 2025-08-20 11:30:58 -04:00
msg Check off REPL-ing todo add masked usage in `drain_to_final_msg()` 2025-09-11 10:13:04 -04:00
trionics Tweaks from copilot, type fix, typos, language. 2025-09-11 10:01:25 -04:00
__init__.py move tractor._ipc.py into tractor.ipc._chan.py 2025-07-08 12:57:28 -04:00
_addr.py Move concrete `Address`es to each tpt module 2025-07-08 18:05:05 -04:00
_child.py Adjust `._child` instantiation of `Actor` to use newly named `uuid` arg 2025-07-08 12:57:28 -04:00
_clustering.py Fix cluster suite, chng to new `gather_contexts()` 2025-08-18 10:46:37 -04:00
_context.py Solve another OoB cancellation case, the bg task one 2025-09-11 13:12:52 -04:00
_discovery.py Switch to strict-eg nurseries almost everywhere 2025-08-18 10:46:37 -04:00
_entry.py Drop `actor_info: str` from `._entry` logs 2025-08-15 16:24:06 -04:00
_exceptions.py Move `.is_multi_cancelled()` to `.trioniics._beg` 2025-07-16 15:49:18 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_multiaddr.py Fix doc string "its" typo.. 2025-03-20 19:50:31 -04:00
_portal.py Set `Channel._cancel_called` via `chan` var 2025-08-18 21:30:48 -04:00
_root.py Hide `collapse_eg()` frame as used from `open_root_actor()` 2025-08-20 10:44:42 -04:00
_rpc.py Drop `tn` arg to `maybe_raise_from_masking_exc()` in `._rpc` 2025-08-20 12:45:49 -04:00
_runtime.py Comment/docs tweaks per copilot reivew 2025-08-20 12:36:08 -04:00
_spawn.py Add attempt at non-root-parent REPL guarding 2025-08-19 14:15:14 -04:00
_state.py Add initial `repl_fixture` support B) 2025-07-14 00:00:12 -04:00
_streaming.py Mk `.devx._debug` a sub-pkg `.devx.debug` 2025-07-14 00:00:12 -04:00
_supervise.py Rename var for and hide the `_open_and_supervise_one_cancels_all_nursery` frame 2025-09-11 10:13:04 -04:00
log.py Implicitly name sub-logs by caller's mod 2025-09-11 17:05:35 -04:00
to_asyncio.py Comment tweaks per copilot review 2025-08-19 12:33:47 -04:00