Skip to content
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
10 changes: 9 additions & 1 deletion mail_environment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# -*- coding: utf-8 -*-
from . import env_mail
import logging

_logger = logging.getLogger(__name__)

try:
from . import env_mail
except ImportError:
_logger.info("ImportError raised while loading module.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to tell which module is not able to be imported!

suggested:

   _logger.info("ImportError raised while loading env_mail module.")

@yajo yajo Dec 23, 2016

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need, the logs already say where do error come from, that's implicit by getLogger(__name__)

_logger.debug("ImportError details:", exc_info=True)
10 changes: 9 additions & 1 deletion server_environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from .serv_config import serv_config, setboolean
import logging

_logger = logging.getLogger(__name__)

try:
from .serv_config import serv_config, setboolean
except ImportError:
_logger.info("ImportError raised while loading module.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here!

_logger.debug("ImportError details:", exc_info=True)