Skip to content

Instantly share code, notes, and snippets.

@mkorpela
Created March 13, 2012 13:58
Show Gist options
  • Save mkorpela/2028933 to your computer and use it in GitHub Desktop.
Save mkorpela/2028933 to your computer and use it in GitHub Desktop.
Monkey that somehow got out of his cage
from robot.libraries.BuiltIn import BuiltIn
def run_flat(name, *args):
"""
This keyword flattens robot logs. Only messages will be logged - no keyword structure.
"""
from robot.output import LOGGER
s, e = LOGGER.start_keyword, LOGGER.end_keyword
LOGGER.start_keyword = LOGGER.end_keyword = lambda *_:0
try:
return BuiltIn().run_keyword(name, *args)
finally:
LOGGER.start_keyword, LOGGER.end_keyword = s, e
@vkosuri
Copy link

vkosuri commented Nov 10, 2018

@mkorpela Thanks for sharing, could you please let me know how to use this keyword?

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