Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger.log_background_messages() not found in source function #450

Open
OKHand-Zy opened this issue Aug 30, 2024 · 1 comment
Open

logger.log_background_messages() not found in source function #450

OKHand-Zy opened this issue Aug 30, 2024 · 1 comment

Comments

@OKHand-Zy
Copy link

I am trying to create a package for myself, but when I reviewed the function logger.log_background_messages(),
I checked the source code in src/robot/api/logger.py, but I couldn't find the log_background_messages() function.
I would like to ask if this function is working or not.

def close(self):
"""Closes the connection."""
if self.tunnel:
self.tunnel.close()
self._sftp_client = None
self._scp_transfer_client = None
self._scp_all_client = None
self._shell = None
self.client.close()
try:
logger.log_background_messages()
except AttributeError:
pass

@Noordsestern
Copy link
Member

Noordsestern commented Aug 30, 2024

Hi,

thanks. Good question... I think, this was supposed to work before Python2 support has been dropped a few days ago on master. I think the logger import in client.py is wrong and should be

from .logger import logger

That uses the library specific logger, which optionally is Backgroundlogger:

try:
from robotbackgroundlogger import BackgroundLogger
logger = BackgroundLogger()
except ImportError:
from robot.api import logger

I am not sure though if Backgroundlogger is still required. I just started debugging the project.

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

No branches or pull requests

2 participants