mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 19:28:00 +00:00
lf_logger_config_test.py : example program lf_sublogger.py : included module sample lf_sublogger_2.py : included an inherited module same. This code is for becomming familiar with the logging module
24 lines
690 B
Python
24 lines
690 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import os
|
|
import logging
|
|
import importlib
|
|
|
|
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../")))
|
|
lf_sublogger_2 = importlib.import_module("py-scripts.sandbox.lf_sublogger_2")
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def sublogger():
|
|
logger.debug("A DEBUG message from " + __name__)
|
|
logger.info("An INFO message from " + __name__)
|
|
logger.warning("An WARNING message from " + __name__)
|
|
logger.error("An ERROR message from + " + __name__)
|
|
logger.critical("An CRITICAL message from + " + __name__)
|
|
lf_sublogger_2.sublogger()
|
|
logger.error("An ERROR message from + " + __name__)
|
|
lf_sublogger_2.sublogger_2a()
|