mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00

The work consists of three parts: * Allow for bootstrapping remotely, this makes it possible to run the tests on e.g. OSX with VirtualBox installed * Make bootstrapping a fully automated process where the manifests can be generated by the tests and the tests can call the bootstrapper directly in python * Create a framework wherein instances can be booted up using the bootstrapped images and subsequently tested
24 lines
500 B
Python
24 lines
500 B
Python
import logging
|
|
import pickle
|
|
|
|
class LogForwarder(logging.Handler):
|
|
|
|
def __init__(self, level=logging.NOTSET):
|
|
self.server = None
|
|
super(LogForwarder, self).__init__(level)
|
|
|
|
def set_server(self, server):
|
|
self.server = server
|
|
|
|
def emit(self, record):
|
|
if self.server is not None:
|
|
self.server.handle(pickle.dumps(record))
|
|
|
|
|
|
class LogServer(object):
|
|
|
|
def handle(self, pickled_record):
|
|
import logging
|
|
log = logging.getLogger()
|
|
record = pickle.loads(pickled_record)
|
|
log.handle(record)
|