def _start_logging(self):
    self.log = logging.getLogger('TestFramework')
    self.log.setLevel(logging.DEBUG)
    fh = logging.FileHandler((self.options.tmpdir + '/test_framework.log'))
    fh.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ll = (int(self.options.loglevel) if self.options.loglevel.isdigit() else self.options.loglevel.upper())
    ch.setLevel(ll)
    formatter = logging.Formatter(fmt='%(asctime)s.%(msecs)03d000 %(name)s (%(levelname)s): %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
    formatter.converter = time.gmtime
    fh.setFormatter(formatter)
    ch.setFormatter(formatter)
    self.log.addHandler(fh)
    self.log.addHandler(ch)
    if self.options.trace_rpc:
        rpc_logger = logging.getLogger('BitcoinRPC')
        rpc_logger.setLevel(logging.DEBUG)
        rpc_handler = logging.StreamHandler(sys.stdout)
        rpc_handler.setLevel(logging.DEBUG)
        rpc_logger.addHandler(rpc_handler)
def _start_logging(self):
    self.log = logging.getLogger('TestFramework')
    self.log.setLevel(logging.DEBUG)
    fh = logging.FileHandler((self.options.tmpdir + '/test_framework.log'))
    fh.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ll = (int(self.options.loglevel) if self.options.loglevel.isdigit() else self.options.loglevel.upper())
    ch.setLevel(ll)
    formatter = logging.Formatter(fmt='%(asctime)s.%(msecs)03d000 %(name)s (%(levelname)s): %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
    formatter.converter = time.gmtime
    fh.setFormatter(formatter)
    ch.setFormatter(formatter)
    self.log.addHandler(fh)
    self.log.addHandler(ch)
    if self.options.trace_rpc:
        rpc_logger = logging.getLogger('BitcoinRPC')
        rpc_logger.setLevel(logging.DEBUG)
        rpc_handler = logging.StreamHandler(sys.stdout)
        rpc_handler.setLevel(logging.DEBUG)
        rpc_logger.addHandler(rpc_handler)