예제 #1
0
	def test_remotelogging(self):
		from xpra.server.mixins.logging_server import LoggingServer, log
		logfn = log.log
		try:
			messages = []
			def newlogfn(*args):
				messages.append(args)
			log.log = newlogfn
			x = LoggingServer()
			proto = AdHocStruct()
			x._server_sources = {proto : "fake-source"}
			opts = AdHocStruct()
			opts.remote_logging = "on"
			x.init(opts)
			level = 20
			msg = "foo"
			packet = ["logging", level, msg]
			x._process_logging(proto, packet)
			assert len(messages)==1
		finally:
			log.log = logfn
예제 #2
0
 def _LoggingServer():
     ls = LoggingServer()
     ls.do_log = newlogfn
     return ls
예제 #3
0
 def _LoggingServer():
     ls = LoggingServer()
     ls.do_log = do_log
     return ls
예제 #4
0
 def test_invalid(self):
     l = LoggingServer()
     opts = AdHocStruct()
     opts.remote_logging = "on"
     l.init(opts)
     l._process_logging(None, None)
예제 #5
0
 def test_invalid(self):
     l = LoggingServer()
     opts = AdHocStruct()
     opts.remote_logging = "on"
     l.init(opts)
     l._process_logging(None, None)  #pylint: disable=protected-access