diff options
Diffstat (limited to 'oslo_log/fixture')
-rw-r--r-- | oslo_log/fixture/__init__.py | 16 | ||||
-rw-r--r-- | oslo_log/fixture/logging_error.py | 7 | ||||
-rw-r--r-- | oslo_log/fixture/setlevel.py | 4 |
3 files changed, 24 insertions, 3 deletions
diff --git a/oslo_log/fixture/__init__.py b/oslo_log/fixture/__init__.py index e69de29..577ac91 100644 --- a/oslo_log/fixture/__init__.py +++ b/oslo_log/fixture/__init__.py @@ -0,0 +1,16 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from .logging_error import get_logging_handle_error_fixture +from .setlevel import SetLogLevel diff --git a/oslo_log/fixture/logging_error.py b/oslo_log/fixture/logging_error.py index 3823a03..9a3140a 100644 --- a/oslo_log/fixture/logging_error.py +++ b/oslo_log/fixture/logging_error.py @@ -18,8 +18,11 @@ import fixtures def get_logging_handle_error_fixture(): """returns a fixture to make logging raise formatting exceptions. - Usage: - self.useFixture(logging.get_logging_handle_error_fixture()) + To use:: + + from oslo_log import fixture as log_fixture + + self.useFixture(log_fixture.get_logging_handle_error_fixture()) """ return fixtures.MonkeyPatch('logging.Handler.handleError', _handleError) diff --git a/oslo_log/fixture/setlevel.py b/oslo_log/fixture/setlevel.py index 4938911..d3e2e2c 100644 --- a/oslo_log/fixture/setlevel.py +++ b/oslo_log/fixture/setlevel.py @@ -23,7 +23,9 @@ class SetLogLevel(fixtures.Fixture): To use:: - self.setFixture(['myapp.foo'], logging.DEBUG) + from oslo_log import fixture as log_fixture + + self.useFixture(log_fixture.SetLogLevel(['myapp.foo'], logging.DEBUG)) :param logger_names: Sequence of logger names, as would be passed to getLogger(). |