Skip to content

Commit aed5196

Browse files
Use __name__ instead of root for client result & common logger NREL#111 (comment)
1 parent 9a21531 commit aed5196

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/geophires_x_client/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
_geophires_x_client_logger = None
55

66

7-
def _get_logger(logger_name='root'):
7+
def _get_logger(logger_name=None):
88
global _geophires_x_client_logger
99
if _geophires_x_client_logger is None:
1010
sh = logging.StreamHandler(sys.stdout)
1111
sh.setLevel(logging.INFO)
1212
sh.setFormatter(logging.Formatter(fmt='[%(asctime)s][%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S'))
1313

14+
if logger_name is None:
15+
logger_name = __name__
16+
1417
_geophires_x_client_logger = logging.getLogger(logger_name)
1518
_geophires_x_client_logger.addHandler(sh)
1619

src/geophires_x_client/geophires_x_result.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ class GeophiresXResult:
280280
'Reservoir Model',
281281
)
282282

283-
def __init__(self, output_file_path, logger_name='root'):
283+
def __init__(self, output_file_path, logger_name=None):
284+
if logger_name is None:
285+
logger_name = __name__
284286
self._logger = _get_logger(logger_name)
285287
self.output_file_path = output_file_path
286288

0 commit comments

Comments
 (0)