File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ VERSION 2.X.X
99 Improvements:
1010 * Simplified setup and deployment (@mwtoews)
1111 * Faster shape access when missing shx file
12+ * Switch to named logger (see #240)
1213
1314 Bug fixes:
1415 * More robust handling of corrupt shapefiles (fixes #235)
Original file line number Diff line number Diff line change 2020from datetime import date
2121import zipfile
2222
23+ # Create named logger
24+ logger = logging .getLogger (__name__ )
25+
2326
2427# Module settings
2528VERBOSE = True
@@ -568,13 +571,13 @@ def __geo_interface__(self):
568571 but the Shape contained interior holes (defined by counter-clockwise orientation in the shapefile format) that were \
569572 orphaned, i.e. not contained by any exterior rings. The rings were still included but were \
570573 encoded as GeoJSON exterior rings instead of holes.'
571- logging .warning (msg )
574+ logger .warning (msg )
572575 only_holes = self ._errors .get ('polygon_only_holes' , None )
573576 if only_holes :
574577 msg = header + 'Shapefile format requires that polygons contain at least one exterior ring, \
575578 but the Shape was entirely made up of interior holes (defined by counter-clockwise orientation in the shapefile format). The rings were \
576579 still included but were encoded as GeoJSON exterior rings instead of holes.'
577- logging .warning (msg )
580+ logger .warning (msg )
578581
579582 # return as geojson
580583 if len (polys ) == 1 :
@@ -904,7 +907,7 @@ class ShapefileException(Exception):
904907# if len(messages) > 1:
905908# # more than just the "Summary of..." header
906909# msg = '\n'.join(messages)
907- # logging .warning(msg)
910+ # logger .warning(msg)
908911
909912class Reader (object ):
910913 """Reads the three files of a shapefile as a unit or
You can’t perform that action at this time.
0 commit comments