Skip to content

log_deprecation: no way to keep a deprecation a client cannot act on out of its logsΒ #447

Description

@goldyfruit

πŸ€– Auto-generated by Claude Fable 5.1 (claude-fable-5-1) via Claude Code β€” NOT human-reviewed. Verify before acting.

ovos_utils.log.log_deprecation names the logger it writes to after the call site:

log_name = f"{LOG.name} - {name}:{func_name or call[3]}:{call[2]}"
LOG.create_logger(log_name).warning(...)

create_logger gives that logger its own StreamHandler and sets propagate = False. So every deprecation lands on a logger such as OVOS - ovos_bus_client.session:_normalize_location_input:87, one per call site, that no client can name in advance, and a filter on the OVOS logger never sees it. There is no configuration or environment switch for deprecations either (checked LOG.init and the logging config keys in ovos-utils 0.8.5).

Why it matters: ovos-bus-client 2.11 logs a deprecation every time it reads a session whose location is in the nested city/coordinate/timezone shape. A hub whose ovos-core still serialises that shape (every stock install: ovos-config's default location is nested) makes every client log it on every message it receives. Measured on a HiveMind satellite: three lines per question, and three hundred in six minutes of connection probes. The client cannot change the hub's shape, so the only honest thing it can do is drop that one record β€” and the only place to catch it is LOG.create_logger itself, which is what we wrap today (thalovant 0.6.7, transport.py).

Would you take either of these?

  1. An opt-out: LOG.init(config={"deprecations": False}) / "logging": {"deprecations": false} in mycroft.conf, or OVOS_LOG_DEPRECATIONS=0, under which log_deprecation returns without logging.
  2. A fixed child logger for deprecations (OVOS.deprecation, with the call site kept in the message as it is now) so a standard logging.Filter or level can be applied to it.

Either would let a client that has heard the deprecation, and cannot act on it, stop repeating it. Happy to send a PR for whichever you prefer.

Versions: ovos-utils 0.8.5, ovos-bus-client 2.11.7a1, Python 3.12.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions