diff --git a/src/geophires_x_client/common.py b/src/geophires_x_client/common.py index 5460cfe8..dbb076ad 100644 --- a/src/geophires_x_client/common.py +++ b/src/geophires_x_client/common.py @@ -4,13 +4,16 @@ _geophires_x_client_logger = None -def _get_logger(logger_name='root'): +def _get_logger(logger_name=None): global _geophires_x_client_logger if _geophires_x_client_logger is None: sh = logging.StreamHandler(sys.stdout) sh.setLevel(logging.INFO) sh.setFormatter(logging.Formatter(fmt='[%(asctime)s][%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')) + if logger_name is None: + logger_name = __name__ + _geophires_x_client_logger = logging.getLogger(logger_name) _geophires_x_client_logger.addHandler(sh) diff --git a/src/geophires_x_client/geophires_x_result.py b/src/geophires_x_client/geophires_x_result.py index 26e9b03a..523f6892 100644 --- a/src/geophires_x_client/geophires_x_result.py +++ b/src/geophires_x_client/geophires_x_result.py @@ -280,7 +280,9 @@ class GeophiresXResult: 'Reservoir Model', ) - def __init__(self, output_file_path, logger_name='root'): + def __init__(self, output_file_path, logger_name=None): + if logger_name is None: + logger_name = __name__ self._logger = _get_logger(logger_name) self.output_file_path = output_file_path