Utils Module — pynexusic 2.5.0 documentation

# Utils Module

This module provides helper function.

Prerequisites:

- Python > 3.7

utils.launchDocs()

  Launches documentation in the default OS browser

  Returns

    No return

utils.print_log(msg, logger=None, logLvl=20)

  Print message to console and log in logger

  Parameters

    - msg – (`string`) - Message to be printed

    - logger – (`Logger` - optional) - Logger variable to be used to print in log file (default value None)

    - logLvel – (`int` - optional) - Logging level number (default value logging.INFO, which is equivalent to 20)

  Returns

    No return

utils.setup_logger(name, log_file, formatter=None, logLvl=20)

  Setup logger to create a log file

  Parameters

    - name – (`string`) - Name of the logger

    - log_file – (`string`) - Name of the log file

    - formatter – (`string` - optional) - Format of the log file (default value None)

    - logLvel – (`int` - optional) - Logging level number (default value logging.INFO, which is equivalent to 20)

  Returns

    (`Logger`) - Logger object