def __log(self, level, msg):
        from . import testexecutor

        try:
            running_test_fixture = testexecutor.current_executor().get_property("running_test_fixture")
        except __HOLE__:
            pconsole.write_line("[%s] %s" % (logging.getLevelName(level), msg))
        else:
            running_test_fixture.logs.append({"level": logging.getLevelName(level).lower(), "message": str(msg)})

            if config.get_option("verbose"):
                # output to pconsole
                message = "[%s] %s" % (running_test_fixture.full_name, msg)
                pconsole.write_line(message)
dataset/ETHPy150Open KarlGong/ptest/ptest/plogger.py/PReporter.__log