Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround isce2 setting root logger to debug #177

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.9.3]
### Fixed
* @scottyhq fixed excessively verbose logging due to ISCE2 setting the root logger to `DEBUG` in [#176](https://github.com/ASFHyP3/hyp3-isce2/issues/176)

## [0.9.2]
### Fixed
* `No annotation xml file` error in `insar_tops_burst` when processing HH pairs. Fixes [#168](https://github.com/ASFHyP3/hyp3-isce2/issues/168).
Expand Down
8 changes: 7 additions & 1 deletion src/hyp3_isce2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
"""HyP3 plugin for ISCE2 processing"""
import logging
import os
from importlib.metadata import version
from pathlib import Path

# 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

# ISCE2 sets the root logger to DEBUG resulting in excessively verbose logging, see:
# 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')
if ISCE_APPLICATIONS not in (PATH := os.environ['PATH'].split(os.pathsep)):
os.environ['PATH'] = os.pathsep.join([ISCE_APPLICATIONS] + PATH)


__version__ = version(__name__)

__all__ = [
Expand Down
Loading