Set Log Level for Built in Keywords in Robotframework

In robot framework, it looks like it logs messages for keywords like "=" by default with 'INFO' log level. Ex:

<Test case>
  ${xyz} = "hello"

Would log message with:

'INFO': ${xyz} = "hello"

I would like to lower the log level for this to 'DEBUG' or 'TRACE' but can't seem to find it in the source code. An advice for this?

2

3 Answers

Also, you can set your log level in the code. Like this:

  Test Setup                Set Log Level    TRACE

Then in the log.html file, a visible log level dropdown is shown in the upper right corner. This allows users to remove messages below the chosen level from the view. This can be useful especially when running tests at the TRACE level.

for more information see:

Have you tried to execute the test bringing the whole execution to a deeper level "DEBUG" or "TRACE" adding this -L trace or -L debug to your test call. robot -L trace mytest.robot for instance.

1

Source code defined like this

    def log(self, message, level='INFO', html=False, console=False,
            repr=False, formatter='str'):
        u"""Logs the given message with the given level.

        Valid levels are TRACE, DEBUG, INFO (default), HTML, WARN, and ERROR.
        Messages below the current active log level are ignored. See
        `Set Log Level` keyword and ``--loglevel`` command line option
        for more details about setting the level.

usage example Log you message:{message} level=DEBUG

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest