MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / __set_log_forward

Method __set_log_forward

src/python/openvpn3/SessionManager.py:453–471  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

451 # added or removed.
452 #
453 def __set_log_forward(self):
454 # The LogCallback and the StatusChangeCallback both need LogForward
455 # enabled. In other words, LogForward should be enabled if one or both
456 # of those callbacks are registered.
457 should_log_forward_be_enabled = (
458 self.__log_callback is not None or self.__status_callback is not None
459 )
460
461 if should_log_forward_be_enabled and not self.__log_forward_enabled:
462 self.__session_intf.LogForward(True)
463 self.__log_forward_enabled = True
464 elif not should_log_forward_be_enabled and self.__log_forward_enabled:
465 try:
466 self.__session_intf.LogForward(False)
467 except dbus.exceptions.DBusException:
468 # If this fails, the session is typically already removed
469 pass
470
471 self.__log_forward_enabled = False
472
473
474##

Callers 2

LogCallbackMethod · 0.95
StatusChangeCallbackMethod · 0.95

Calls 1

LogForwardMethod · 0.80

Tested by

no test coverage detected