Skip to content
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
15 changes: 15 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ This library uses (`hecdss.dll` on Windows and `libhecdss.so` on Unix/Linux). h
```


## Message Levels

Message levels can be set using `set_global_debug_level` or `set_debug_level`, for example:

```python
from hecdss import HecDss
mlvl: int = 4
HecDss.set_global_debug_level(mlvl)
```

Common levels are described in the documentation for the `mlvl` parameter of the `zset` utility function from the [HEC-DSS Programmers Guide for C](https://www.hec.usace.army.mil/confluence/dssdocs/dsscprogrammer)

Additional levels are described in the heclib source code C headers in [zdssMessages.h](https://github.com/HydrologicEngineeringCenter/hec-dss/blob/master/heclib/heclib_c/src/headers/zdssMessages.h)


## how to generate documentation

pdoc -o docs -d google --no-show-source .\src
Expand Down
8 changes: 6 additions & 2 deletions src/hecdss/hecdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def set_global_debug_level(level: int) -> None:
Sets the library debug level

Args:
level (int): a value between 0 and 15. Larger for more output
level (int): a value between 0 and 15. Larger for more output.
For level descriptions, see zdssMessages.h of the heclib source code,
or documentation from the HEC-DSS Programmers Guide for C on the `mlvl` parameter of the `zset` utility function.
"""
_Native().hec_dss_set_debug_level(level)
def close(self):
Expand Down Expand Up @@ -743,7 +745,9 @@ def set_debug_level(self, level) -> int:
"""sets the DSS debug level.

Args:
level (int): a value between 0 and 15. Larger for more output
level (int): a value between 0 and 15. Larger for more output.
For level descriptions, see zdssMessages.h of the heclib source code,
or documentation from the HEC-DSS Programmers Guide for C on the `mlvl` parameter of the `zset` utility function.

Returns:
int: _description_
Expand Down
2 changes: 2 additions & 0 deletions src/hecdss/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def __hec_dss_set_value(self, name: str, value: int):
# set debug level (0-15)
# 0 - no output
# 15 - max output
# for additional levels: see zdssMessages.h of the heclib source code,
# or documentation from the HEC-DSS Programmers Guide for C on `mlvl` parameter of the `zset` utility function.
def hec_dss_set_debug_level(self, value: int):
self.__hec_dss_set_value("mlvl", value)

Expand Down
Loading