EWTS is a multi-language logging framework for hydrologic modules running either
within ngen or as standalone applications. It provides consistent log levels,
module identity handling, environment-driven configuration, and a common bridge
model across C, C++, Fortran, and Python.
Under ngen, EWTS routes log messages through the ngen integration layer so
configuration, formatting, and output location are controlled centrally. In
standalone mode, each runtime applies the same general policy while handling its
own file output.
This repository provides:
- runtime logging libraries for C, C++, Fortran, and Python
- the
ngenintegration bridge and logger implementation - generated module constants and log-level definitions
- generator tooling that keeps constants synchronized across languages
- MkDocs content for user-facing documentation
EWTS supports two execution contexts:
-
ngen-integrated logging- the
ngenintegration layer owns configuration and output policy - logging configuration is read from
ngen_logging.json - output is written beneath
NGEN_RESULTS_DIR/logs/ - files are generated per MPI rank
- output can be unified or split by module
- the
-
Standalone runtime logging
- each language runtime writes its own log output
- runtime behavior is controlled by environment variables such as
EWTS_ENABLED,EWTS_LOG_LEVEL, andEWTS_LOG_DIR - output falls back through
EWTS_LOG_DIR,$HOME/run_logs, and./run_logs
runtime/
c/ C Runtime Library
cpp/ C++ Runtime Library
fortran/ Fortran Runtime Library
python/ Python package
integrations/
ngen/ ngen bridge and logger integration
spec/
module_registry.yaml
log_levels.json
tools/
generate_language_constants.py
docs/ MkDocs source
cmake -B cmake_buld -S . -DCMAKE_BUILD_TYPE=Release -DEWTS_WITH_NGEN=ON -DEWTS_BUILD_SHARED=ON
cmake --build cmake_buld -jThe top-level build compiles the native language-specific Runtime Libraries and builds the Python package.
cmake --install cmake_buld --prefix /path/to/installThe install tree includes:
- C Runtime Library and headers
- C++ Runtime Library and headers
- Fortran Runtime Library and module files
- generated constants for supported languages
ngenintegration library when enabled- CMake package configuration files
- Python wheel output from the top-level build
For direct Python development:
pip install -e runtime/python/ewtsTo build a wheel manually:
python -m cmake_buld runtime/python/ewtsEWTS uses specification files as the single source of truth for module metadata and log levels:
spec/module_registry.yamlspec/log_levels.json
Regenerate language-specific constants with:
python tools/generate_language_constants.pyGenerated files should be treated as derived artifacts and should not be edited by hand.
This repository uses two documentation audiences:
docs/contains user-facing MkDocs content intended to explain the framework, runtime behavior, and integration model.- directory-local
README.mdfiles contain developer-facing documentation intended for contributors working in that part of the repository.
For implementation details, start with:
runtime/c/README.mdruntime/cpp/README.mdruntime/fortran/README.mdruntime/python/README.mdintegrations/ngen/README.mdtools/README.md