Commit Graph

18 Commits (808405fc4cd7aba987ea9248a514dac2d6f365b8)

Author SHA1 Message Date
Gud Boi 808405fc4c Adjust `tractor.log` API compat
Update logging helpers to use new `tractor.log` API with `pkg_name=`
kwarg and add optional `tractor` "root logger" enabling.

Deats,
- change `piker.log.get_logger()` to use `pkg_name=` vs `_root_name=`.
- add `**tractor_log_kwargs` passthrough to both wrapper fns.
- add `with_tractor_log: bool` toggle to `.get_console_log()`.
- strip `'piker.'` prefix from logger names when present to avoid
  newly added `tractor.get_logger()` warnings.

Surroundingly,
- add `subsys` import to `.clearing._ems` for log name
- update all `get_console_log()` calls to use `level=` kwarg
- add assertion checks for logger names in `_setup_persistent_emsd()`

Additionally,,
- fix all type annotations: `str|None` vs `str | None`.
- add multiline style to conditional in `.cli.services()`.
- drop unused `Optional` import from `._actor_runtime`.
- drop a few "blank lines" in various function sigs.

Warning: this patch will require an equivalent dev-commit at the time of
writing in `tractor` itself, for now the `piker_pin` branch should be
sufficient to avoid breakage 🙏!

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code

k
2026-02-06 10:35:01 -05:00
Tyler Goodlet b2827ef3c3 Group bcast errors as `Sampler.bcast_errors`
A new class var `tuple[Exception]` such that the err set can be reffed
externally as needed for catching other similar pub-sub/IPC failures in
other (related) real-time sub-systems.

Also added some now-masked logging for debugging live-feed stream reading
issues that should ONLY be used for debugging since they'll greatly
degrade HFT perf. Used the new `log.mk_repr()` stuff (that one day we
should prolly pull from `modden` as a dep) for pretty console emissions.
2025-02-21 16:24:54 -05:00
Tyler Goodlet cf1f4bed75 Move `.accounting` related config loaders to subpkg
Like you'd think:
- `load_ledger()` -> ._ledger
- `load_accounrt()` -> ._pos

Also fixup the old `load_pps_from_ledger()` and expose it from a new
`.accounting.cli.disect` cli cmd for trying to figure out why pp calcs
are totally mucked on stupid ib..
2023-06-27 13:42:08 -04:00
Tyler Goodlet b078a06621 Doc string and types bump in loggin mod 2023-03-09 15:37:42 -05:00
Tyler Goodlet c256d3bdc0 Type annot name in put to log routine 2022-06-05 22:13:36 -04:00
Tyler Goodlet c1109ee3fb Add license headers to pertinent files 2020-11-06 12:23:14 -05:00
Tyler Goodlet 8e2e695ba8 Revert project name removal; breaks shit elsewhere somehow.. 2020-10-02 12:13:50 -04:00
Tyler Goodlet 268e748417 Drop extra prefix in logs 2020-10-02 12:13:50 -04:00
Tyler Goodlet 732638ae2d Delegate logging to `tractor`
Gives us PIDs and task ids in logs which is much more sane for
debugging and cuts down on superfluous code.
2020-02-29 12:29:20 -05:00
Tyler Goodlet d102b82566 Don't add more then one stderr handler 2018-11-22 16:31:01 -05:00
Tyler Goodlet a05a8cc557 Include process name in log messages 2018-05-16 20:39:47 -04:00
Tyler Goodlet 4b59b87f98 Add convenience methods for all log levels 2018-02-22 18:44:00 -05:00
Tyler Goodlet 0997418a47 Be PC 2018-02-09 22:01:14 -05:00
Tyler Goodlet adecc082ac Save `brokers.ini` in the user config dir using click 2018-02-08 02:39:18 -05:00
Tyler Goodlet 534ba0b698 Add json highlighting; make debug msgs white 2018-01-26 11:31:40 -05:00
Tyler Goodlet c6cff5a432 Swap debug-garbage log colours 2018-01-25 20:59:56 -05:00
Tyler Goodlet c7258f3fb2 Build bold palette automatically 2018-01-22 22:05:42 -05:00
Tyler Goodlet 15fe580326 Super hot hipster logging 2018-01-22 22:05:42 -05:00