diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index 77fd7cda5a..3344f1b498 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -103,7 +103,6 @@ def callback(cube, field, filename): import contextlib import glob import itertools -import logging import os.path import threading @@ -131,11 +130,6 @@ def callback(cube, field, filename): 'IrisDeprecation'] -# When required, log the usage of Iris. -if iris.config.IMPORT_LOGGER: - logging.getLogger(iris.config.IMPORT_LOGGER).info('iris %s' % __version__) - - Constraint = iris._constraints.Constraint AttributeConstraint = iris._constraints.AttributeConstraint diff --git a/lib/iris/config.py b/lib/iris/config.py index a20b7bb5a0..eb44ec0bd8 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -116,17 +116,9 @@ def get_dir_option(section, option, default=None): PALETTE_PATH = get_dir_option(_RESOURCE_SECTION, 'palette_path', os.path.join(CONFIG_PATH, 'palette')) - -################# -# Logging options -_LOGGING_SECTION = 'Logging' - -IMPORT_LOGGER = get_option(_LOGGING_SECTION, 'import_logger') - - -################# # Runtime options + class NetCDF(object): """Control Iris NetCDF options.""" diff --git a/lib/iris/etc/site.cfg.template b/lib/iris/etc/site.cfg.template index b78e9c4b97..ef5459cc92 100644 --- a/lib/iris/etc/site.cfg.template +++ b/lib/iris/etc/site.cfg.template @@ -6,5 +6,3 @@ dot_path = /path/to/dot # see iris.fileformats.dot sample_data_dir = /path/to/iris/resources/sample_data test_data_dir = /path/to/iris/resources/test_data -[Logging] -import_logger = logger_name diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 480239c295..8c37a9785b 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -45,7 +45,6 @@ import inspect import json import io -import logging import math import os import os.path @@ -146,9 +145,6 @@ os.environ['IRIS_TEST_CREATE_MISSING'] = 'true' -# A shared logger for use by unit tests -logger = logging.getLogger('tests') - # Whether to display matplotlib output to the screen. _DISPLAY_FIGURES = False @@ -430,7 +426,6 @@ def assertDataAlmostEqual(self, data, reference_filename, **kwargs): self.assertArrayAllClose(nstats, data_stats, **kwargs) else: self._ensure_folder(reference_path) - logger.warning('Creating result file: %s', reference_path) stats = collections.OrderedDict([ ('std', np.float_(data.std())), ('min', np.float_(data.min())), @@ -449,7 +444,6 @@ def assertFilesEqual(self, test_filename, reference_filename): fmt.format(test_filename, reference_path)) else: self._ensure_folder(reference_path) - logger.warning('Creating result file: %s', reference_path) shutil.copy(test_filename, reference_path) def assertString(self, string, reference_filename=None): @@ -492,7 +486,6 @@ def _check_same(self, item, reference_path, type_comparison_name='CML'): type_comparison_name) else: self._ensure_folder(reference_path) - logger.warning('Creating result file: %s', reference_path) with open(reference_path, 'wb') as reference_fh: reference_fh.writelines( part.encode('utf-8') @@ -694,7 +687,6 @@ def _check_reference_file(self, reference_path): def _ensure_folder(self, path): dir_path = os.path.dirname(path) if not os.path.exists(dir_path): - logger.warning('Creating folder: %s', dir_path) os.makedirs(dir_path) def check_graphic(self): diff --git a/lib/iris/tests/pp.py b/lib/iris/tests/pp.py index 6f166bc1eb..02f72e80b9 100644 --- a/lib/iris/tests/pp.py +++ b/lib/iris/tests/pp.py @@ -58,7 +58,6 @@ def cube_save_test(self, reference_txt_path, reference_cubes=None, reference_pp_ """ # Watch out for a missing reference text file if not os.path.isfile(reference_txt_path): - tests.logger.warning('Creating result file: %s', reference_txt_path) if reference_cubes: temp_pp_path = iris.util.create_temp_filename(".pp") try: diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 1e03bdfbf4..f7e5a3c4a5 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -55,7 +55,6 @@ def check_dot(self, cube, reference_filename): reference = ''.join(reference_fh.readlines()) self._assert_str_same(reference, test_string, reference_filename, type_comparison_name='DOT files') else: - tests.logger.warning('Creating result file: %s', reference_path) with open(reference_path, 'w') as reference_fh: reference_fh.writelines(test_string) diff --git a/lib/iris/tests/test_coord_api.py b/lib/iris/tests/test_coord_api.py index d7c0f25d99..4708e2febb 100644 --- a/lib/iris/tests/test_coord_api.py +++ b/lib/iris/tests/test_coord_api.py @@ -23,7 +23,6 @@ import iris.tests as tests from xml.dom.minidom import Document -import logging import cf_units import numpy as np @@ -37,7 +36,6 @@ import iris.tests.stock -logger = logging.getLogger('tests') @tests.skip_data diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index 0c1f7a501b..25be9bb1be 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2010 - 2016, Met Office +# (C) British Crown Copyright 2010 - 2017, Met Office # # This file is part of Iris. # @@ -22,7 +22,6 @@ # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests -import logging import cartopy.crs as ccrs import cf_units @@ -34,7 +33,6 @@ from iris.coord_systems import * -logger = logging.getLogger('tests') def osgb(): diff --git a/lib/iris/tests/test_image_json.py b/lib/iris/tests/test_image_json.py index 972edeb28e..d04cc4e1bd 100644 --- a/lib/iris/tests/test_image_json.py +++ b/lib/iris/tests/test_image_json.py @@ -27,7 +27,6 @@ import codecs import itertools import json -import logging import os import requests import unittest diff --git a/lib/iris/tests/test_pp_module.py b/lib/iris/tests/test_pp_module.py index e3106f95e4..acdaff158e 100644 --- a/lib/iris/tests/test_pp_module.py +++ b/lib/iris/tests/test_pp_module.py @@ -89,7 +89,6 @@ def check_pp(self, pp_fields, reference_filename): reference = ''.join(reference_fh.readlines()) self._assert_str_same(reference+'\n', test_string+'\n', reference_filename, type_comparison_name='PP files') else: - tests.logger.warning('Creating result file: %s', reference_path) with open(reference_path, 'w') as reference_fh: reference_fh.writelines(test_string)