Skip to content

Scope Logger suppression to armctl package and dependencies only#55

Closed
Copilot wants to merge 6 commits intomainfrom
copilot/link-logger-suppression
Closed

Scope Logger suppression to armctl package and dependencies only#55
Copilot wants to merge 6 commits intomainfrom
copilot/link-logger-suppression

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

The RTDE library maintains its own logger instance that ignores Logger.disable() and ARMCTL_LOG=0, causing unwanted log output during controller version detection. Additionally, the original implementation using logging.disable(logging.CRITICAL) was suppressing ALL loggers globally in the Python process, which could affect other libraries.

Changes

  • Added _LOGGERS_TO_MANAGE list containing "armctl" and "rtde" logger namespaces
  • Modified Logger.disable() to set logger levels to CRITICAL + 1 (fully suppresses all messages) for armctl and dependency loggers only
  • Modified Logger.enable() to reset logger levels to NOTSET for armctl and dependency loggers
  • Removed global logging.disable() calls - no longer affects other libraries' loggers
  • Added test coverage for RTDE logger suppression
  • Added test to verify other library loggers are NOT affected by Logger.disable()

Behavior

Logger.disable() and ARMCTL_LOG=0 now only suppress:

  • armctl package loggers (anything under "armctl" namespace)
  • Dependency loggers like "rtde"

Other library loggers continue to work normally and are NOT affected.

Example

import logging
from armctl import Logger

armctl_logger = logging.getLogger("armctl.test")
rtde_logger = logging.getLogger("rtde")
other_logger = logging.getLogger("some.other.library")

Logger.disable()
armctl_logger.info("Suppressed")  # No output
rtde_logger.info("Suppressed")  # No output
other_logger.info("Still visible")  # Output visible

Logger.enable()
armctl_logger.info("Now visible")  # Output visible
rtde_logger.info("Now visible")  # Output visible

The _LOGGERS_TO_MANAGE list makes it straightforward to add additional dependency loggers as needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Link Logger Supression to Dependencies with Loggers</issue_title>
<issue_description>If I use either

ARMCTL_LOG=0
Logger.disable()

... any dependency libraries should have their loggers linked to this function for suppression.

Currently, RTDE calls a logger when grabbing the controller version:

self.controller_version = (
self.c.get_controller_version()
) # (MAJOR, MINOR, BUGFIX, BUILD)

(See underlying source code here)

I'd like to use

logging.getLogger("rtde")

somewhere to mutually suppress it.</issue_description>

<agent_instructions>make minimal changes</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

MGross21 and others added 2 commits February 16, 2026 11:21
- use ctype u32 for robot status bit typing
- add lamda function to make return dict clearer from function doctring
Copilot AI and others added 2 commits February 16, 2026 19:24
Co-authored-by: MGross21 <18691704+MGross21@users.noreply.github.com>
…nability

Co-authored-by: MGross21 <18691704+MGross21@users.noreply.github.com>
Copilot AI changed the title [WIP] Link logger suppression to dependencies with loggers Link Logger suppression to RTDE dependency logger Feb 16, 2026
Copilot AI requested a review from MGross21 February 16, 2026 19:28
@MGross21 MGross21 marked this pull request as ready for review February 16, 2026 19:30
@MGross21 MGross21 changed the base branch from ur-rtde to main February 16, 2026 19:33
@MGross21
Copy link
Owner

@copilot logging.disable(logging.CRITICAL) disables loggers globally. I just want to target this package and any dependencies below.

Copilot AI and others added 2 commits February 16, 2026 19:49
… global logging

Co-authored-by: MGross21 <18691704+MGross21@users.noreply.github.com>
Co-authored-by: MGross21 <18691704+MGross21@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot logging.disable(logging.CRITICAL) disables loggers globally. I just want to target this package and any dependencies below.

Changed to only suppress armctl and dependency loggers instead of using global logging.disable(). Now Logger.disable() and ARMCTL_LOG=0 only affect loggers under the "armctl" namespace and dependencies like "rtde", leaving other library loggers unaffected. (commit db0cc27)

Copilot AI changed the title Link Logger suppression to RTDE dependency logger Scope Logger suppression to armctl package and dependencies only Feb 16, 2026
@MGross21 MGross21 closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link Logger Supression to Dependencies

2 participants