Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename _logger -> log in Optislang() class and api documentation. #47

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/api/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For these two types of loggers, the default log message format is:

>>> from ansys.optislang.core import Optislang
>>> osl = Optislang(loglevel='INFO')
>>> osl._logger.info('This is an useful message')
>>> osl.log.info('This is an useful message')

.. code:: bash

Expand Down
4 changes: 2 additions & 2 deletions src/ansys/optislang/core/optislang.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self.__name = name
self.__password = password

self._logger = LOG.add_instance_logger(self.name, self, loglevel)
self.log = LOG.add_instance_logger(self.name, self, loglevel)
self.__osl_server: OslServer = self.__init_osl_server("tcp")

def __init_osl_server(self, server_type: str) -> OslServer:
Expand Down Expand Up @@ -124,7 +124,7 @@ def __init_osl_server(self, server_type: str) -> OslServer:
no_save=self.__no_save,
ini_timeout=self.__ini_timeout,
password=self.__password,
logger=self._logger,
logger=self.log,
)
else:
raise NotImplementedError(f'OptiSLang server of type "{server_type}" is not supported.')
Expand Down