I can set visible log level when giving command: robot -L TRACE:INFO from terminal and it is working ok (Robot Framework User Guide ). But I’d like to set the visible-log-level from the test suite/code, but haven’t found t a way to do that. Is there some way to do that because ‘Set Log Level’ doesn’t take <log_level>:<visible_log_level> as value.
Why this is not possible with Set Log Level? Possible values there are only TRACE, DEBUG, INFO, WARN, ERROR and NONE (http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Set%20Log%20Level)
I would assume that setting the log level at runtime would be “too late” because something before setting the log level has already had a possible output to console ?
I was curious why you’d set 2 log levels on the command line, what’s the difference, after reading the documentation you linked, and a few others sections of the user guide, I think I understand.
When you use robot -L TRACE:INFO the log level is at Trace while running, but when the test finishes the log level for the log.html is set to default to Info.
So I’m wondering if you can achieve the same by calling Set Log Level TRACE in your Setup, or wherever you need to call it, and then call Set Log Level INFO in your Teardown?