Files
deb-python-reno/reno/__init__.py
Doug Hellmann b11e2fbf29 add a null logging handler
Python libraries that log should set a NullHandler in case the
application where they are used does not set up logging. Reno's use in
the Sphinx extension and in some release tools generates warnings the
first time logging calls are made because of the missing handler.

Change-Id: Ia8455d72f4b5e861d023b541a8ea9db786d53637
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-01-19 16:19:08 -05:00

26 lines
877 B
Python

# -*- coding: utf-8 -*-
# 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.
import logging
import pbr.version
__version__ = pbr.version.VersionInfo(
'reno').version_string()
# Configure a null logger so that if reno is used as a library by an
# application that does not configure logging there are no warnings.
logging.getLogger(__name__).addHandler(logging.NullHandler())