From 5a3413f7f359e2cc4bd36e18d2a13f4c5799e017 Mon Sep 17 00:00:00 2001 From: Scott Henderson Date: Fri, 12 Jan 2024 08:25:46 -0800 Subject: [PATCH] logger fix in init file --- src/hyp3_isce2/__init__.py | 4 ++++ src/hyp3_isce2/insar_tops_burst.py | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hyp3_isce2/__init__.py b/src/hyp3_isce2/__init__.py index 1f987c08..54e60a4a 100644 --- a/src/hyp3_isce2/__init__.py +++ b/src/hyp3_isce2/__init__.py @@ -2,10 +2,14 @@ import os from importlib.metadata import version from pathlib import Path +import logging # Ensures all ISCE2 paths and environment variables are set when using this module, see: # https://github.com/isce-framework/isce2/blob/main/__init__.py#L41-L50 import isce # noqa: F401 +# https://github.com/isce-framework/isce2/issues/258 +root_logger = logging.getLogger() +root_logger.setLevel('WARNING') # ISCE2 also needs its applications to be on the system path, even though they say it's only "for convenience", see: # https://github.com/isce-framework/isce2#setup-your-environment ISCE_APPLICATIONS = str(Path(os.environ['ISCE_HOME']) / 'applications') diff --git a/src/hyp3_isce2/insar_tops_burst.py b/src/hyp3_isce2/insar_tops_burst.py index 49b3c724..9beb31da 100644 --- a/src/hyp3_isce2/insar_tops_burst.py +++ b/src/hyp3_isce2/insar_tops_burst.py @@ -12,9 +12,6 @@ from typing import Optional import isce -# https://github.com/isce-framework/isce2/issues/258 -root_logger = logging.getLogger() -root_logger.setLevel('WARNING') from hyp3lib.aws import upload_file_to_s3 from hyp3lib.get_orb import downloadSentinelOrbitFile from hyp3lib.image import create_thumbnail