Skip to content

Commit 1398b51

Browse files
authored
Change logging default value to be error (#77)
1 parent 1ebebe3 commit 1398b51

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

codegen/adr_utils.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def get_logger(logfile=None):
6060
The logger object.
6161
"""
6262
logger = logging.getLogger()
63-
logger.setLevel(logging.DEBUG)
63+
logger.setLevel(logging.ERROR)
6464
if logfile is None:
6565
# Logging for Python APIs should be disabled by default
6666
ch = logging.NullHandler()
6767
elif logfile=='stdout':
6868
ch = logging.StreamHandler(sys.stdout)
6969
else:
7070
ch = logging.FileHandler(logfile)
71-
ch.setLevel(logging.DEBUG)
71+
ch.setLevel(logging.ERROR)
7272
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
7373
ch.setFormatter(formatter)
7474
logger.addHandler(ch)

src/ansys/dynamicreporting/core/adr_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def stop(self) -> None:
544544
except Exception:
545545
pass
546546
if v is False:
547-
self.logger.warning("Error validating the connected service. Can't shut it down.\n")
547+
self.logger.error("Error validating the connected service. Can't shut it down.\n")
548548
else:
549549
# If coming from a docker image, clean that up
550550
try:
@@ -556,7 +556,7 @@ def stop(self) -> None:
556556
self.logger.info("Told service to shutdown.\n")
557557
self.serverobj.stop_local_server()
558558
except Exception as e:
559-
self.logger.warning(f"Problem shutting down service.\n{str(e)}\n")
559+
self.logger.error(f"Problem shutting down service.\n{str(e)}\n")
560560
pass
561561

562562
if self._delete_db and self._db_directory:

tests/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_unit_nexus_stop(request) -> bool:
6464
a = Service(logfile=logfile)
6565
a.stop()
6666
f = open(logfile)
67-
assert "There is no service connected to the current session" in f.read()
67+
assert "Error validating the connected service" in f.read()
6868

6969

7070
@pytest.mark.ado_test

0 commit comments

Comments
 (0)