Skip to content

Commit

Permalink
Merge pull request #323 from kubilus1/fixlogs
Browse files Browse the repository at this point in the history
Fix log handler being overridden
  • Loading branch information
kubilus1 authored Aug 19, 2023
2 parents 3b403d6 + 1d81117 commit 1de65f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion autoortho/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ def setuplogs():
if not os.path.isdir(log_dir):
os.makedirs(log_dir)

log_level=logging.DEBUG if os.environ.get('AO_DEBUG') or CFG.general.debug else logging.INFO
logging.basicConfig(
#filename=os.path.join(log_dir, "autoortho.log"),
level=logging.DEBUG if os.environ.get('AO_DEBUG') or CFG.general.debug else logging.INFO,
level=log_level,
handlers=[
#logging.FileHandler(filename=os.path.join(log_dir, "autoortho.log")),
logging.handlers.RotatingFileHandler(
Expand All @@ -24,6 +25,8 @@ def setuplogs():
logging.StreamHandler()
]
)
log = logging.getLogger(__name__)
log.info(f"Setup logs: {log_dir}, level: {log_level}")

import autoortho

Expand Down
6 changes: 1 addition & 5 deletions autoortho/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@
from aoconfig import CFG

import logging
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
log = logging.getLogger(__name__)

if not log:
print("NO LOG")
print(log)

TESTMODE=os.environ.get('AO_TESTMODE', False)


Expand Down Expand Up @@ -720,6 +715,7 @@ def find_regions(self):


if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, stream=sys.stdout)

parser = argparse.ArgumentParser(
description = "AutoOrtho Scenery Downloader"
Expand Down
2 changes: 1 addition & 1 deletion autoortho/getortho.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get(self, idx=0):

MAPTYPES = {
"EOX": f"https://{server}.s2maps-tiles.eu/wmts/?layer={MAPID}&style=default&tilematrixset={MATRIXSET}&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={self.zoom}&TileCol={self.col}&TileRow={self.row}",
"BI": f"http://ecn.t{server_num}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=13716",
"BI": f"http://ecn.t{server_num}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=13816",
"GO2": f"http://khms{server_num}.google.com/kh/v=934?x={self.col}&y={self.row}&z={self.zoom}",
"ARC": f"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{self.zoom}/{self.row}/{self.col}",
"NAIP": f"http://naip.maptiles.arcgis.com/arcgis/rest/services/NAIP/MapServer/tile/{self.zoom}/{self.row}/{self.col}",
Expand Down

0 comments on commit 1de65f0

Please sign in to comment.