Skip to content

Commit 860afcd

Browse files
Changes reflecting change in functionality
1 parent 51f1c0b commit 860afcd

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,12 @@ these steps:
161161
3. Build dpctl with code coverage support.
162162

163163
```bash
164-
python setup.py develop --coverage=True
165-
pytest -q -ra --disable-warnings --cov dpctl --cov-report term-missing --pyargs dpctl -vv
164+
python scripts/gen_coverage.py --oneapi
166165
coverage html
167166
```
168167

169168
Note that code coverage builds the C sources with debug symbols. For this
170-
reason, the coverage flag is only available with the `develop` mode of
169+
reason, the coverage script builds the package in `develop` mode of
171170
`setup.py`.
172171

173172
The coverage results for the C and Python sources will be printed to the
@@ -194,14 +193,14 @@ these steps:
194193

195194
## Error Reporting and Logging
196195

197-
Use the `DPCTL_VERBOSITY` environment variable to print errors of different severity levels from the libsyclinterface library to the console.
198-
You can specify one of the following severity levels (in increasing order of severity): `warning` and `error`.
196+
The SyclInterface library responds to `DPCTL_VERBOSITY` environment variable that controls the severity level of errors printed to console.
197+
One can specify one of the following severity levels (in increasing order of severity): `warning` and `error`.
199198

200199
```bash
201-
export DPCTL_VERBOSITY=error
200+
export DPCTL_VERBOSITY=warning
202201
```
203202

204-
Messages of a given severity are shown not only in the console for that severity, but also for a lower severity. For example, the severity level `error` will output severity errors for `error` and `warning` to the console.
203+
Messages of a given severity are shown not only in the console for that severity, but also for the higher severity. For example, the severity level `warning` will output severity errors for `error` and `warning` to the console.
205204

206205
### Optional use of the Google logging library (glog)
207206

@@ -218,15 +217,24 @@ conda install glog
218217
python scripts/build_locally.py --oneapi --glog
219218
```
220219
221-
3. Use `DPCTLService_InitLogger` and `DPCTLService_ShutdownLogger` functions during development to initialize the Google's logging library and de-initialize accordingly
220+
3. Use `dpctl._diagnostics.syclinterface_diagnostics(verbosity="warning", log_dir=None)` context manager to switch library diagnostics on for a block of Python code.
221+
Use `DPCTLService_InitLogger` and `DPCTLService_ShutdownLogger` library C functions during library development to initialize the Google's logging library and de-initialize accordingly
222222

223-
```bash
223+
```python
224+
from dpctl._diagnostics import syclinterface_diagnostics
225+
import dpctl
226+
227+
with syclinterface_diagnostics():
228+
code
229+
```
230+
231+
```c
224232
DPCTLService_InitLogger(const char *app_name, const char *log_dir);
225233
DPCTLService_ShutdownLogger();
226234
```
227235

228236
- `*app_name` - name of the executable file (prefix for logs of various levels).
229-
- `*log_dir` - directory path for writing log files.
237+
- `*log_dir` - directory path for writing log files. Specifying `NULL` results in logging to ``std::cerr``.
230238

231239
> **_NOTE:_**
232240
>

0 commit comments

Comments
 (0)