How to use set_level method in Robotframework

Best Python code snippet using robotframework

log.py

Source:log.py Github

copy

Full Screen

...6 Set log level.7 """8 if isinstance(log_level, six.string_types):9 if log_level.upper() == "DEBUG":10 stclog.Logs().set_level(logging.DEBUG)11 elif log_level.upper() == "INFO":12 stclog.Logs().set_level(logging.INFO)13 elif log_level.upper() == "WARN":14 stclog.Logs().set_level(logging.WARN)15 elif log_level.upper() == "ERROR":16 stclog.Logs().set_level(logging.ERROR)17 elif log_level.upper() == "WARNING":18 stclog.Logs().set_level(logging.WARNING)19 elif log_level.upper() == "CRITICAL":20 stclog.Logs().set_level(logging.CRITICAL)21 else:22 stclog.Logs().set_level(logging.INFO)23 elif isinstance(log_level, int):24 if log_level in [logging.DEBUG, logging.INFO, logging.ERROR,25 logging.WARN, logging.WARNING, logging.CRITICAL]:26 stclog.Logs().set_level(log_level)27 else:28 stclog.Logs().set_level(logging.INFO)29 else:30 stclog.Logs().set_level(logging.INFO)31# Global logger32logger = stclog.Logs().get_logger("cloud_connect_engine")33def reset_logger(name):34 """35 Reset logger.36 """37 stclog.reset_logger(name)38 global logger...

Full Screen

Full Screen

spin-spi.py

Source:spin-spi.py Github

copy

Full Screen

1from microbit import *2import time3import machine4b = bytearray(13*2)5def set_level(n, l):6 l = ((l >> 1) & 1) | ((l >> 2) & 2) | ((l >> 3) & 4) | ((l >> 4) & 8)7 8 if n >= 12:9 n += 110 b[(n + 1)] = l11def update():12 spi.init(baudrate=100000, bits=8, mode=0, sclk=pin0, mosi=pin13, miso=None)13 spi.write(b)14 15 # spi1->enable = 016 machine.mem8[0x40004500] = 017 # pin 13 = 018 machine.mem8[0x5000050e] |= 0b1000000019 for i in range(4):20 # pin13 = 121 machine.mem8[0x5000050a] |= 0b1000000022 # pin13 = 023 machine.mem8[0x5000050e] |= 0b1000000024while True:25 for i in range(24):26 set_level((i + 21) % 24, 0)27 set_level((i + 22) % 24, 2)28 set_level((i + 23) % 24, 10)29 set_level((i + 24) % 24, 255)30 set_level((i + 25) % 24, 10)31 set_level((i + 26) % 24, 2)32 set_level((i + 27) % 24, 0)33 update()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Robotframework automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful