Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-48-aria-cli cadc6aae7 -> 0833c0d39
Add NullHandlers handlers to Storage loggers This is since the absence of a handler shows up while using the CLI in the form of: `No handlers could be found for logger "aria.ResourceStorage"` Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/0833c0d3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/0833c0d3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/0833c0d3 Branch: refs/heads/ARIA-48-aria-cli Commit: 0833c0d397c1e017a568ffe40954b0355a045f6b Parents: cadc6aa Author: Avia Efrat <[email protected]> Authored: Thu Mar 30 14:05:46 2017 +0300 Committer: Avia Efrat <[email protected]> Committed: Thu Mar 30 14:05:46 2017 +0300 ---------------------------------------------------------------------- aria/storage/core.py | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0833c0d3/aria/storage/core.py ---------------------------------------------------------------------- diff --git a/aria/storage/core.py b/aria/storage/core.py index 8302fc9..0e900bb 100644 --- a/aria/storage/core.py +++ b/aria/storage/core.py @@ -37,6 +37,7 @@ API: * drivers - module, a pool of ARIA standard drivers. * StorageDriver - class, abstract model implementation. """ +import logging from aria.logger import LoggerMixin from . import sql_mapi @@ -71,6 +72,10 @@ class Storage(LoggerMixin): :param kwargs: """ super(Storage, self).__init__(**kwargs) + # Set the logger handler of any storage object to NullHandler. + # This is since the absence of a handler shows up while using the CLI in the form of: + # `No handlers could be found for logger "aria.ResourceStorage"`. + self.logger.addHandler(logging.NullHandler()) self.api = api_cls self.registered = {} self._initiator = initiator
