lfcli_base.py: can now import lanforge_client.logg

Adds notes on where present logg() function is being used

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
Jed Reynolds
2021-11-03 14:17:16 -07:00
parent 4f2fe934a3
commit 2f7baf2987

View File

@@ -22,10 +22,14 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../")))
debug_printer = pprint.PrettyPrinter(indent=2) debug_printer = pprint.PrettyPrinter(indent=2)
LFRequest = importlib.import_module("py-json.LANforge.LFRequest") LFRequest = importlib.import_module("py-json.LANforge.LFRequest")
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
Logg = importlib.import_module("lanforge_client.logg")
if os.environ.get("LF_USE_AUTOGEN") == 1: if os.environ.get("LF_USE_AUTOGEN") == 1:
lanforge_api = importlib.import_module("lanforge_client.lanforge_api") lanforge_api = importlib.import_module("lanforge_client.lanforge_api")
LFSession = lanforge_api.LFSession LFSession = lanforge_api.LFSession
Logg = lanforge_api.Logg
class LFCliBase: class LFCliBase:
@@ -34,11 +38,8 @@ class LFCliBase:
SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit
# - LOGGING - # - LOGGING -
_logger = None _logger = logging.getLogger(__name__)
if os.environ.get("LF_USE_AUTOGEN") == 1:
_logger = Logg.logger
_method_name_list = []
_tag_list = []
# do not use `super(LFCLiBase,self).__init__(self, host, port, _debug) # do not use `super(LFCLiBase,self).__init__(self, host, port, _debug)
# that is py2 era syntax and will force self into the host variable, making you # that is py2 era syntax and will force self into the host variable, making you
@@ -523,6 +524,14 @@ class LFCliBase:
mesg=None, mesg=None,
filename=None, filename=None,
scriptname=None): scriptname=None):
"""
This method is used by vr_profile2, lf_create_bcast, and shadowed by base_profile.py
:param level:
:param mesg:
:param filename:
:param scriptname:
:return:
"""
if (mesg is None) or (mesg == "") or (level is None): if (mesg is None) or (mesg == "") or (level is None):
return return
userhome=os.path.expanduser('~') userhome=os.path.expanduser('~')