Skip to content

Commit b83692a

Browse files
Update CONTRIBUTING.md
1 parent 32469d2 commit b83692a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,43 @@ these steps:
191191
> ```
192192
> The error is related to the `tcl` package. You should uninstall the `tcl`
193193
> package to resolve the error.
194+
195+
## Error Reporting and Logging
196+
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`.
199+
200+
```bash
201+
export DPCTL_VERBOSITY=error
202+
```
203+
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.
205+
206+
### Optional use of the Google logging library (glog)
207+
208+
Dpctl's error handler for libsyclinterface can be optionally configured to use [glog](https://github.com/google/glog). To use glog, follow the following steps:
209+
210+
1. Install glog package of the latest version (0.5.0)
211+
212+
```bash
213+
conda install glog
214+
```
215+
2. Build dpctl with glog support
216+
217+
```bash
218+
python scripts/build_locally.py --oneapi --glog
219+
```
220+
221+
3. Use `DPCTLService_InitLogger` and `DPCTLService_ShutdownLogger` functions during development to initialize the Google's logging library and de-initialize accordingly
222+
223+
```bash
224+
DPCTLService_InitLogger(const char *app_name, const char *log_dir);
225+
DPCTLService_ShutdownLogger();
226+
```
227+
228+
- `*app_name` - name of the executable file (prefix for logs of various levels).
229+
- `*log_dir` - directory path for writing log files.
230+
231+
> **_NOTE:_**
232+
>
233+
> If `InitGoogleLogging` is not called before first use of glog, the library will self-initialize to `logtostderr` mode and log files will not be generated.

0 commit comments

Comments
 (0)