From d433e024ce91e680b1d2a7803d986b0544cdac7f Mon Sep 17 00:00:00 2001 From: JGStew Date: Thu, 29 Aug 2024 20:15:42 -0400 Subject: [PATCH] rename logging config function --- examples/export_all_sites.py | 6 +++++- src/besapi/besapi.py | 2 +- src/besapi/plugin_utilities.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/export_all_sites.py b/examples/export_all_sites.py index b80774f..1098704 100644 --- a/examples/export_all_sites.py +++ b/examples/export_all_sites.py @@ -104,7 +104,11 @@ def main(): print(log_file_path) - besapi.plugin_utilities.setup_plugin_logging(log_file_path) + logging_config = besapi.plugin_utilities.get_plugin_logging_config( + log_file_path, verbose, args.console + ) + + logging.basicConfig(**logging_config) logging.info("----- Starting New Session ------") logging.debug("invoke folder: %s", invoke_folder) diff --git a/src/besapi/besapi.py b/src/besapi/besapi.py index f904b4f..6171fe9 100644 --- a/src/besapi/besapi.py +++ b/src/besapi/besapi.py @@ -29,7 +29,7 @@ from lxml import etree, objectify from pkg_resources import resource_filename -__version__ = "3.4.2" +__version__ = "3.5.1" besapi_logger = logging.getLogger("besapi") diff --git a/src/besapi/plugin_utilities.py b/src/besapi/plugin_utilities.py index b7381a9..d04103d 100644 --- a/src/besapi/plugin_utilities.py +++ b/src/besapi/plugin_utilities.py @@ -88,8 +88,8 @@ def setup_plugin_argparse(plugin_args_required=False): return arg_parser -def setup_plugin_logging(log_file_path="", verbose=0, console=True): - """setup logging for plugin use""" +def get_plugin_logging_config(log_file_path="", verbose=0, console=True): + """get config for logging for plugin use""" if not log_file_path or log_file_path == "": log_file_path = os.path.join(