Suppressing log messages

Hi,

I’m using the rpaframework directly with python. How do I suppress some of the log messages?

For example, i’m using get_text() function in the PDF library and it prints out “Did not find any matches with locator” and “No anchor(s) set for locator” messages every time it doesn’t find a match. It’s a bit annoying.

I looked at RobotLogListener library but not sure how to use that and if that’s only meant for the Robot Framework.

Appreciate some help.

Thanks.

Hi, I don’t know if this will work for you but you can check how set the log level in robot.yaml file here. Also you can use levels below INFO (the default) so they don’t appear unless you set that level like this:

"""Template robot with Python."""
from robot.api import logger


def minimal_task():
    print("Done.")


if __name__ == "__main__":
    minimal_task()
    logger.trace("This is a trace log!")
    logger.debug("This is a debug log!")
    logger.info("This is a info log!")
    logger.info("This is a info console log!", also_console=True)
    logger.warn("This is a warning log!")
    logger.error("This is a error log!")
    logger.console("This is a console log!")