示例#1
0
 def parse_server_capabilities(self, c: typedict) -> bool:
     if self.remote_logging.lower(
     ) in ("send", "both", "yes", "true", "on") and (
             #'remote-logging.receive' was only added in v4.1 so check both:
             c.boolget("remote-logging")
             or c.boolget("remote-logging.receive")):
         #check for debug:
         from xpra.log import is_debug_enabled
         conflict = tuple(v
                          for v in ("network", "crypto", "udp", "websocket")
                          if is_debug_enabled(v))
         if conflict:
             log.warn("Warning: cannot enable remote logging")
             log.warn(" because debug logging is enabled for: %s",
                      csv(conflict))
             return True
         log.info("enabled remote logging")
         if not self.log_both:
             log.info(" see server log file for further output")
         self.local_logging = set_global_logging_handler(
             self.remote_logging_handler)
     elif self.remote_logging.lower() == "receive":
         self.request_server_log = c.boolget("remote-logging.send")
         if not self.request_server_log:
             log.warn("Warning: cannot receive log output from the server")
             log.warn(
                 " the feature is not enabled or not supported by the server"
             )
         else:
             self.after_handshake(self.start_receiving_logging)  #pylint: disable=no-member
     return True
示例#2
0
 def parse_server_capabilities(self):
     c = self.server_capabilities
     if self.client_supports_remote_logging and c.boolget("remote-logging"):
         #check for debug:
         from xpra.log import is_debug_enabled
         for x in ("network", "crypto", "udp"):
             if is_debug_enabled(x):
                 log.warn("Warning: cannot enable remote logging")
                 log.warn(" because '%s' debug logging is enabled", x)
                 return True
         log.info("enabled remote logging")
         if not self.log_both:
             log.info(" see server log file for further output")
         self.local_logging = set_global_logging_handler(self.remote_logging_handler)
     return True
示例#3
0
 def parse_server_capabilities(self, c: typedict) -> bool:
     if self.client_supports_remote_logging and c.boolget("remote-logging"):
         #check for debug:
         from xpra.log import is_debug_enabled
         conflict = tuple(v
                          for v in ("network", "crypto", "udp", "websocket")
                          if is_debug_enabled(v))
         if conflict:
             log.warn("Warning: cannot enable remote logging")
             log.warn(" because debug logging is enabled for: %s",
                      csv(conflict))
             return True
         log.info("enabled remote logging")
         if not self.log_both:
             log.info(" see server log file for further output")
         self.local_logging = set_global_logging_handler(
             self.remote_logging_handler)
     return True
示例#4
0
 def cleanup(self):
     ll = self.local_logging
     if ll:
         set_global_logging_handler(ll)
示例#5
0
 def stop_capturing_logging(self):
     ll = self.local_logging
     if ll:
         self.local_logging = None
         set_global_logging_handler(ll)
示例#6
0
 def start_capturing_logging(self):
     if not self.local_logging:
         self.local_logging = set_global_logging_handler(self.remote_logging_handler)
示例#7
0
 def cleanup(self):
     ll = self.local_logging
     log("cleanup() local_logging=%s", ll)
     if ll:
         self.local_logging = None
         set_global_logging_handler(ll)