Skip to content

Commit

Permalink
improve baseline plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Mar 29, 2024
1 parent 014cfaa commit 66fa6df
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/baseline_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def process_baselines(config):

def main():
"""Execution starts here"""
print("main()")
print("main() start")

parser = argparse.ArgumentParser(
description="Provde command line arguments for REST URL, username, and password"
Expand Down Expand Up @@ -216,7 +216,7 @@ def main():
invoke_folder = get_invoke_folder()

# set different log levels:
log_level = logging.WARNING
log_level = logging.INFO
if verbose:
log_level = logging.INFO
if verbose > 1:
Expand All @@ -225,6 +225,8 @@ def main():
# get path to put log file in:
log_filename = os.path.join(invoke_folder, "baseline_plugin.log")

print(f"Log File Path: {log_filename}")

handlers = [
logging.handlers.RotatingFileHandler(
log_filename, maxBytes=5 * 1024 * 1024, backupCount=1
Expand All @@ -245,7 +247,7 @@ def main():
logging.info("----- Starting New Session ------")
logging.debug("invoke folder: %s", invoke_folder)
logging.debug("Python version: %s", platform.sys.version)
logging.debug("BESAPI Module version: %s", besapi.__version__)
logging.debug("BESAPI Module version: %s", besapi.besapi.__version__)
logging.debug("this plugin's version: %s", __version__)

# process args, setup connection:
Expand Down Expand Up @@ -293,6 +295,7 @@ def main():
logging.info("Trigger File Does Not Exists, skipping execution!")

logging.info("----- Ending Session ------")
print("main() End")


if __name__ == "__main__":
Expand Down

0 comments on commit 66fa6df

Please sign in to comment.